Chapter 1 (And Modules 1 - 3)

Ace your homework & exams now with Quizwiz!

How to create a sample code with just the 'print'

#This is a comment print("Hello, World!") print("My name is Suma Rao") print("Goodbye!")

System software and 3 Types

- programs that control and manage basic operations of a computer 3 Types: -Operating system -Utility Program -Software development tools

Secondary storage

-Main: can hold data for long periods of time -Programs normally stored here and loaded to main memory when needed

Main memory (also known as what?)

-Random Access Memory or RAM -where computer stores a program while the program is running, and data used by the program

High-Level language

-allows simple creation of powerful and complex programs -No need to know how CPU works or write large number of instructions -More intuitive to understand

Unicode coding scheme becoming standard

-becoming standard -Compatible with ASCII -Can represent characters for other languages

To store negative numbers and real numbers, computers use (?) Negative numbers encoded using (?) Real numbers encoded using (?)

-binary numbering and encoding schemes -two's complement -floating-point notation

Low-level language

-close in nature to machine language -Example: assembly language

Input device

-component that collects the data -Examples: keyboard, mouse, touchscreen, scanner, camera -Disk drives can be considered input devices because they load programs into the main memory

Statement

-individual instruction used in high-level language ( >>> print("Hello") )

Python must be (?)

-installed and configured prior to use ----One of the items installed is the Python interpreter

Byte

-just enough memory to store letter or small number -Divided into eight bits -Bit: electrical component that can hold positive or negative charge, like on/off switch -The on/off pattern of bits in a byte represents data stored in the byte

Digital images are composed (?), To store images, (?)

-of pixels -each pixel is converted to a binary number representing the pixel's color

Operators

-perform operations on data (+, -, *, /, //, %) -Example: math operators to perform arithmetic

Key words

-predefined words used to write program in high-level language (refer to Keywords chart in the next slide) -Each key word has specific meaning

Digital music is composed of sections called (?), To store music, (?)

-samples -each sample is converted to a binary number

Program must be copied from (?), CPU executes program in cycle

-secondary memory to RAM each time CPU executes it - Fetch, Decode, and Execute

Syntax

-set of rules to be followed when writing program

CPU designed to perform (?) and examples, Understands instructions written in (?), Each brand of CPU has (?), To carry out meaningful calculation, (?)

-simple operations on pieces of data -Examples: reading data, adding, subtracting, multiplying, and dividing numbers -machine language and included in its instruction set -its own instruction set -CPU must perform many operations

Source code

-statements written by programmer ----Syntax error: prevents code from being

Programs written in high-level languages must be (?))

-translated into machine language to be executed

Interpreter

-translates and executes instructions in high-level language program ----Used by Python language ----Interprets one instruction at a time ----No separate machine language program

Compiler

-translates high-level language program into separate machine language program -Machine language program can be executed at any time

Assembly language

-uses short words (mnemonics) for instructions instead of binary numbers -Easier for programmers to work with

What is the file extension of the script/source file that you will create using Python IDLE for python programs/project assignment?

.py

Bit represents two values (?)

0 and 1

Byte size limits are (?)

0 and 255 •0 = all bits off; 255 = all bits on •To store larger number, use several bytes

Typical major components (Hardware)

1. Central processing unit 2. Main memory 3. Secondary storage devices 4. Input and output devices

What is the total weight of your Canvas Quizzes assignment category? (Hint: View your Syllabus Grade Distribution chart)

15%

Which is not a true statement about a bit?

A bit is either a 1 or 2

Which is not a true statement? (Chapter 1 Quiz) A programmer is sometimes referred to as a software developer Microsoft Windows is an example of System Software The CPU is the part of the computer that runs the programs (instructions) Contents of RAM are erased when the computer is turned off (i.e., it's volatile) A program must be copied from RAM into Secondary Storage before it can be executed

A program must be copied from RAM into Secondary Storage before it can be executed

BInary digiT (bit)

All data in a computer is stored in sequences of 0s and 1s

Which of the following steps are part of the Programming Process? All of the answers are part of the programming process Analyzing the problem Documenting the program Coding the program Planning the solution Testing and debugging the program

All of the answers are part of the programming process

Which of the following is not a programming language: C++ C# Swift Python Java All of these are programming languages.

All of these are programming languages.

Which language is referred to as a low-level language?

Assembly language

Microprocessors

CPUs located on small chips

Computers use (?)

Definition: binary numbering system •Position of digit jis assigned the value 2j-1 •To determine value of binary number sum position values of the 1s

Types of secondary memory

Disk drive Solid state drive Flash memory Optical devices

>>>print("Example")

Example

CPU executes program in cycle (Step Meanings)

Fetch: read the next instruction from memory into CPU Decode: CPU decodes fetched instruction to determine which operation to perform Execute: perform the operation

Levels of Programming Languages

High-Level program, Low-Level program, and Executable Machine Code

What does IDE stand for? (Hint: refer to Become familiar with IDE link within this module)

Integrated Development Environment

What is an IDE?

Integrated Development Environment. It is a software application that combines various tools that a developer (programmer) might need. Many IDEs contain a text editor, debugger, compiler, etc...

Python interpreter can be used in two modes:

Interactive mode: enter statements on keyboard Script mode: save statements in Python script

The following is an example of an instruction written in which computer language? 10110000

Machine language

Commonly used IDEs

Microsoft Visual Studio: iC++, C# (C sharp), Python, Visual Basic, etc... NetBeans & Eclipse: Java. Xcode: Macs for Swift, C++, etc... Python: Python IDLE

Which of the following is NOT an IDE? (Hint: refer to Become familiar with IDE link within this module) Xcode Netbeans Visual Studio Notepad Python IDLE

Notepad

Which of the following statement is NOT true? Machine code is produced by the compile process. Machine code or machine language consists of 0s and 1s. Once created, machine code can run on any computer hardware without being re-compiled. A compiler translates source code into executable code.

Once created, machine code can run on any computer hardware without being re-compiled.

Which of the following assignment category requires you to use python IDLE? (Hint: View your SYLLABUS)

Programs/Project

What IDE will we be using in this course to create programs/project?

Python IDLE

ASCII (American Standard Code for Information Interchange), computers only understand (?)

Remember, computers only understand 0s and 1s • The CAPITAL letter D is 68 • Convert 68 to binary: • 64+4 = 68 = 01000100

Everything the computer does is controlled by ? (General Cat.s?)

Software -General cat.s: ----Application software ----System software

Writing Python Programs and Running Them in Script Mode

Statements entered in interactive mode are not saved as a program To have a program use script mode -----Save a set of Python statements in a file -----The filename should have the .py extension -----To run the file, or script, type python filename at the operating system command line

Hardware

The physical devices that make up a computer

Compiler (Chapter 1 Quiz)

Translate high-level programs into separate machine language programs

Interpreter (Chapter 1 Quiz)

Translates each high-level instruction to machine language and then immediately executes them, and then starts over with a new statement

A sandbox is NOT to replace an IDE. (Hint: read How-To Use Sandboxes (and why)? link within this module)

True

A variable is a location in the computer's memory used for storing and retrieving data.

True

An IDE consists of text editor, compiler, debugger, and other utilities integrated into one single component. (Hint: refer to Become familiar with IDE link within this module)

True

LDB that you downloaded and installed in this module will most likely be used in the future to take your quizzes and exams? (Hint: sounds true :)

True

The CPU understands instructions written in a binary machine language.

True

Sandboxes (Online Compiler): It's for those who...

Want to try out Python (or any other language), but don't have a compiler installed Want to try out features your compiler doesn't support Want to practice coding while away from their PC (Way to practice if IDLE is installing or not working)

Interactive Mode

When you start Python in interactive mode, you will see a prompt Indicates the interpreter is waiting for a Python statement to be typed Prompt reappears after previous statement is executed Error message displayed If you incorrectly type a statement -----Good way to learn new parts of Python

Interactive Mode Mac vs Win

Windows: Start the Command Prompt window by typing cmd in the Search box on the taskbar (next to the Start button). ---Then type: python MAC: Start a terminal window using Spotlight (easiest way) Then type: python3

The step-by-step process of performing a task is called the ______________.

algorithm

Data stored in computer must be stored as (?) (Storing Characters)

binary number

The smallest storage location in a computer's memory is known as a

bit

bit: ? byte: ? key word: ? operators: ? (Chapter 1 Quiz)

bit: 0 or 1 byte: 8 bits key word: reserved or pre-defined word in a program operators: +, -, *, = are all examples of this

Which of the following is NOT an online sandbox that is mentioned in the STUDY MATERIALS link How-To Use Sandboxes (and why)? within this module. codepad.org rextester.com cnn.com codechef.com ideone.com

cnn.com

Operating system (System Software)

controls operations of hardware components

Optical devices (Types of Secondary Memory)

data encoded optically

Output

data produced by the computer for other people or devices -examples: Can be text, image, audio, or bit stream

Input

data the computer collects from people and other devices

Digital

describes any device that stores data as binary numbers

Bit

electrical component that can hold positive or negative charge, like on/off switch -The on/off pattern of bits in a byte represents data stored in the byte

Solid state drive (Types of Secondary Memory)

faster than disk drive, no moving parts, stores data in solid state memory

The process known as the ________ cycle is used by the CPU to execute instructions in a program.

fetch-decode-execute

Output device

formats and presents output -Examples: video display, printer -Disk drives and USB drives can be considered output devices because data is sent to them to be saved

Where does a computer store a program and the data that the program is working with while the program is running?

in main memory

The Python ________ is a program that can read Python programming statements and execute them.

interpreter

Impractical for people to write in (?)

machine language

Disk drive (Types of Secondary Memory)

magnetically encodes data onto a spinning circular disk

A program is loaded into _______ while it is being processed on the computer and when the program is not running it is stored in ___________.

memory, secondary storage

Characters are converted to (?), numeric code stored in (?), Most important coding scheme is (?) and it is (?)

numeric code, memory ASCII ASCII is limited: defines codes for only 128 characters

Utility Program (System Software)

performs specific task to enhance computer operation or safeguard data

Programmer (or Software developer)

person who can design, create, and test computer programs

The ability of a language to let a programmer develop a program on a computer system that can be run on other systems is called ________. This usually requires the program to be recompiled on each type of system, but the program itself may need little or no change.

portability

Flash Memory (Types of Secondary Memory)

portable, no physical disk

Syntax error

prevents code from being translated

A(n) ________ is a set of instructions that a computer follows to perform a task.

program

Application software

programs that make computer useful for every day tasks -Examples: word processing, email, games, and Web browsers

Program (or Software)

set of instructions that a computer follows to perform a task

IDLE (Integrated Development Program)

single program that provides tools to write, execute and test a program • Automatically installed when Python language is installed • Runs in interactive mode • Has built-in text editor with features designed to help write Python programs

Which type of error prevents the program from running?

syntax

Central processing unit (CPU)

the part of the computer that actually runs programs -Most important component -Without it, cannot run software -Used to be a huge device

Assembler

translates assembly language to machine language for execution by CPU

Software development tools (System Software)

used to create, modify, and test software programs

Aspects of RAM

• CPU is able to quickly access data in RAM • Volatile memory used for temporary storage while program is running • Contents are erased when computer is off


Related study sets

Chapter 5 Finn 3003 TRUE OR FALSE

View Set

Microservices, Kubernetes Fundamentals, Panel Prep, Micro Services Re-Panel

View Set

Peritonitis and apendicitis Med Surg 1

View Set

RNSG 1413 - Exam 1 Sherpath Adaptive Quizzes

View Set

Chapter 9 - Reaching Global Markets

View Set

American History Unit 2: Lesson 2 - Settling the Frontier

View Set

PEDI Study Guide Ch. 6, 12, 13, 14, 16, 18, 32

View Set

CH 7 (The First 2 Years: Psychosocial Development)

View Set

Highway Design 5510 - Midterm 1 - Michael Shea

View Set