Chapter 2 Flashcards

1
Q

List 5 phases of developing a program

A

design the code, write the code, correct syntax errors, test program, correct logic error

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a logic error is…

A

A logic error is a mistake that does not prevent the program from running, but causes it to produce incorrect results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the person, group or organization that is asking you to write a program.

A

customer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

a single task that the program must perform in order to satisfy the customer.

A

software requirement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

a set of well-defined logical steps that must be taken to perform a task.

A

algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

fake code; informal language that has no syntax rules and is not meant to be complied or executed.

A

pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

any data the program receives while it is running.

A

input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

a piece of prewritten code that performs an operation.

A

function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

the data you want displayed on screen.

A

argument

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

a sequence of characters that is used as data.

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

a name that represents a value stored in the computer’s memory

A

variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

data types

A

int (integer)

float(decimal)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

str:

A

string

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

int:

A

integer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

number with decimal

A

float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

A(n) __________ makes a variable reference a value in the computer’s memory.

A

assignment statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

comment in python

18
Q

integer division

19
Q

raises number to a power

20
Q

In the expression 12 + 7, the values on the right and left of the + symbol are called

A

operands because the symbol is the operator

21
Q

This operator performs division, but instead of returning the quotient it returns the remainder

22
Q
  1. A magic number is ________________.
A

an unexplained value that appears in a program’s code

23
Q

A _ is a name that represents a value that does not change during the program’s execution.

A

variable signature

24
Q

Programmers must be careful not to make syntax errors when writing pseudocode programs true/false

25
In a math expression, multiplication and division take place before addition and subtraction.
Order of operations tells you to perform multiplication and division first, working from left to right, before doing addition and subtraction.
26
Variable names can have spaces in them.
false
27
In Python, the first character of a variable name cannot be a number true/false
true
28
If you print a variable that has not been assigned a value, the number 0 will be displayed
false
29
According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.
false
30
n Python, math expressions are always evaluated from left to right, no matter what the operators are. true/false
false
31
Computer programs typically perform three steps: input is received, some process is performed on the input, and output is produced.
true
32
In Python, print statements written on separate lines do not necessarily output on separate lines.
true
33
All programs are normally stored in ROM and are loaded into RAM as needed for processing.
false
34
The CPU understands instructions written in a binary machine language.
true
35
The Python language uses a compiler which is a program that both translates and executes the instructions in a high-level language.
false
36
IDLE is an alternative method to using a text editor to write, execute, and test a Python program.
true
37
The __________ function reads a piece of data that has been entered at the keyboard and returns that piece of data, as a string, back to the program.
input()
38
Which of the following will display 20% a. print(format(20, '.0%')) b. print(format(0.2, '.0%')) c. print(format(0.2 * 100, '.0%')) d. print(format(0.2, '%'))
print(format(0.2, '.0%'))
39
Where does a computer store a program and the data that the program is working with while the program is running?
main memory
40
When applying the .3f formatting specifier to the number 76.15854, what will be the result?
76.159
41
Python uses __________ to categorize values in memory
data types
42
num = 99 num = 5 print (‘num’)
5