Test 1 Flashcards
Chapter 1, 2, 3, 4 - Checkpoint Questions
What is a program?
A program is a set of instructions that a computer follows to perform a task.
What is hardware?
Hardware is all the physical devices, or components, of which a computer is made.
List the five major components of a computer system?
- CPU (central processing unit)
- Main Memory
- Secondary storage devices
- Input devices
- Output devices
What part of the computer actually runs programs?
The CPU
What part of the computer serves as a work area to store a program and its data while the program is running?
Main Memory
What part of the computer holds data for long periods of time, even when there is no power to the computer?
Secondary Storage
What part of the computer collects data from people and from other devices?
Input devices
What part of the computer formats and presents data for people or the devices?
Output devices
What fundamental set of programs control the internal operations of the computer’s hardware?
The operating system
What do you call a program that performs a specialized task, such as a virus scanner, a file compression program, or a data backup program?
A utility program
Word processing programs, spreadsheets programs, email programs, web browsers, and game programs belong to what category of software?
Application software
What amount of memory is enough to store a letter of the alphabet or a small number?
One byte
What do you call a tiny “switch” that can be set to either on or off?
A bit
In what numbering system are all numeric values written as sequences of 0s and 1s?
The binary numbering system
What is the purpose of ASCII?
“American Standard Code for Information Interchange”
It is an encoding scheme that uses a set of 128 numeric codes to represent the English letters, various punctuation marks, and other characters. These numeric codes are used to store characters in a computer’s memory.
What encoding scheme is extensive enough to represent the characters of many of the languages in the world?
Unicode
What do the terms “digital data”and “digital device” mean?
Digital data is data that is stored in binary
Digital devices is any device that works with binary data
A CPU understands instructions that are written only in what language?
Machine Language
A program has to be copied into what type of memory each time the CPU executes it?
Main Memory (RAM)
When a CPU executes the instructions in the program, it is engaged in what process?
The fetch-decode-execute cycle
What is assembly language?
It is an alternative to machine language. Instead of using binary numbers for instructions, assembly language uses short words that are known as mnemonics.
What type of programming language allows you to create powerful and complex programs without knowing how the CPU works?
A high-level language
Each language has a set of rules that must be strictly followed when writing a program.
What is this set of rules called?
Syntax
What do you call a program that translates a high-level language program into a separate machine language program?
A compiler
What do you call a program that both translates and executes the instructions in high-level language program?
An interpreter
What type of mistake is usually caused by a misspelled keyword, a missing punctuation character, or the incorrect use of an operator?
A syntax error
Who is a programmers customer?
Any person, group, or organization that is asking you to write a program
What is a software requirement?
A single function that the program must perform in order to satisfy the customer
What is an algorithm?
A set of well-defined logical steps that must be taken to perform a task
What is pseudocode?
An informal language that has no syntax rules and is not meant to be compiled or executed. Instead, programmers use pseudocode to create models, or “mock-ups,” of programs.
What is a flowchart?
A diagram that graphically depicts the steps that take place in a program
What do the following symbols mean in a flowchart? Oval, Parallelogram, Rectangle
Ovals - terminal symbols
Parallelograms - are either output or input symbols
Rectangle- are processing symbols
What is a variable?
A name that references a value in the computer’s memory
Which of the following are illegal variable names in Python, and why?
x
99bottles
July2009
theSalesFigureForFiscalYear
r&d
grade_report
- 99bottles is illegal because it begins with a number
- r&d is illegal because the & character is not allowed
What will the following code display?
-val=99
-print(‘The value is’, ‘val’)
The value is val
Look at the following assignment statements:
-value1 = 99
-value2 = 45.9
-value3 = 7.0
-value4 = 7
-value5 = ‘abc’
After these statements execute, what is the Python data type of the values referenced by each variable?
-int
-float
-float
-int
-string
What will be displayed by the following program?
-my_value = 99
-my_value = 0
-print(my_value)
0
You need the user of a program to enter a customer’s last name. Write a statement that prompts the user to enter this data and assigns the input to a variable.
last_name = input(“Enter customer’s last name: “)
You need the user of a program to enter the amount of sales for the week. Write a statement the prompts the user to enter this data and assigns the input to a variable.
sales = float(input(‘Enter the sales for the week: ‘))
Write the value of each expression?
1. 6+3*5
2. 12/2-4
3. 9+14 * 2 -6
4. (6+2) * 3
5. 14 / (11-4)
6. 9 + 12 * (8 -3)
- 21
- 2
-31
-24
-2
-69
What value will be assigned?
Result = 9//2
4
What value will be assigned?
Result = 9%2
1
What is string concatenation?
The appending of one string to the end of another
What value will be assigned?
Results = ‘1’ + ‘2’
12
What value will be assigned?
Result = ‘h’ ‘e’ ‘l’ ‘l’ ‘o’
hello