ch 2 Flashcards

1
Q

the five stages of program development are

A
design program
write code
correct syntax
test program
correct logic
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

software requirement is

A

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

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

mixed type expression

A

an expression that uses operands of different data types

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

pseudocode

A

informal language without syntax not meant to be compiled or executed
create models of programs focusing on design

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

garbage collection

A

a process that removes values in memory that are no longer referenced by variables

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

string

A

sequence of characters

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

variable

A

references a value in computer memory

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

end user

A

hypothetical person using a program providing input for it

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

string literals in python must be enclosed by

A

single or double quotes

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

exception

A

an unexpected error that cause program to halt if it is not solved properly

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

an BLANK makes a variable reference a value in computer’s memory

A

assignment statement

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

what are the operators for floating point division integer division and remainder?

A
/ float
// integer
% remainder
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

function

A

piece of prewritten code that performs an operation

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

algorithm

A

logical steps that must be taken to perform a task

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

a professional programmer will first do what to gain understanding of a problem?

A

they will work directly with the customer
interviews the customer to uncover as many details as possible about the task
creates list of software requirements

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

computer programs perform these 3 steps

A

receive input
perform some process with the input
produce output

17
Q

what is a format specifier and why is it used?

A

its a string that contains special characters specifying how a numeric value should be formatted
its useful in situations where you need a specific decimal precision such as dollar amounts

18
Q

whats the difference between floating point division and integer division

A

the result of each will yield an answer of the respective data type

19
Q

can you reassign multiple variables at once? like (x,y,z)=(a,b,c)

A

yes thats valid

20
Q

whats the line that will format
number = 1234567.456
into 1,234,567.5

A

print(format(number, ‘,.1f’))