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

A

#

18
Q

integer division

A

//

19
Q

raises number to a power

A

**

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

A

%

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

A

false

25
Q

In a math expression, multiplication and division take place before addition and subtraction.

A

Order of operations tells you to perform multiplication and division first, working from left to right, before doing addition and subtraction.

26
Q

Variable names can have spaces in them.

A

false

27
Q

In Python, the first character of a variable name cannot be a number true/false

A

true

28
Q

If you print a variable that has not been assigned a value, the number 0 will be displayed

A

false

29
Q

According to the behavior of integer division, when an integer is divided by an integer, the result will be a float.

A

false

30
Q

n Python, math expressions are always evaluated from left to right, no matter what the operators are. true/false

A

false

31
Q

Computer programs typically perform three steps: input is received, some process is performed on the input, and output is produced.

A

true

32
Q

In Python, print statements written on separate lines do not necessarily output on separate lines.

A

true

33
Q

All programs are normally stored in ROM and are loaded into RAM as needed for processing.

A

false

34
Q

The CPU understands instructions written in a binary machine language.

A

true

35
Q

The Python language uses a compiler which is a program that both translates and executes the instructions in a high-level language.

A

false

36
Q

IDLE is an alternative method to using a text editor to write, execute, and test a Python program.

A

true

37
Q

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.

A

input()

38
Q

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, ‘%’))

A

print(format(0.2, ‘.0%’))

39
Q

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

A

main memory

40
Q

When applying the .3f formatting specifier to the number 76.15854, what will be the result?

A

76.159

41
Q

Python uses __________ to categorize values in memory

A

data types

42
Q

num = 99

     num = 5

     print (‘num’)
A

5