ch 2 Flashcards
the five stages of program development are
design program write code correct syntax test program correct logic
software requirement is
a single function that the program must perform in order to satisfy the customer
mixed type expression
an expression that uses operands of different data types
pseudocode
informal language without syntax not meant to be compiled or executed
create models of programs focusing on design
garbage collection
a process that removes values in memory that are no longer referenced by variables
string
sequence of characters
variable
references a value in computer memory
end user
hypothetical person using a program providing input for it
string literals in python must be enclosed by
single or double quotes
exception
an unexpected error that cause program to halt if it is not solved properly
an BLANK makes a variable reference a value in computer’s memory
assignment statement
what are the operators for floating point division integer division and remainder?
/ float // integer % remainder
function
piece of prewritten code that performs an operation
algorithm
logical steps that must be taken to perform a task
a professional programmer will first do what to gain understanding of a problem?
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
computer programs perform these 3 steps
receive input
perform some process with the input
produce output
what is a format specifier and why is it used?
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
whats the difference between floating point division and integer division
the result of each will yield an answer of the respective data type
can you reassign multiple variables at once? like (x,y,z)=(a,b,c)
yes thats valid
whats the line that will format
number = 1234567.456
into 1,234,567.5
print(format(number, ‘,.1f’))