chapter 2 Flashcards
Who is a programmer’s customer?
A person, group, or organization that is asking you to write a program
What is a software requirement?
A task 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 the task
What is a pseudocode?
An informal language that has no syntax rules and is not meant to be compiled or executed. It is used for designing only purposes.
What is a flowchart?
A diagram that graphically depicts the steps that take place in a program.
What do each of the following symbols mean in a flowchart?
- Oval
- Parallelogram
- Rectangle
- Oval = start and/or the end of a program
- Parallelogram = input/output
- Rectangle = Processing
Write a statement that displays your name
print(‘Gabriela Quihuis’)
Write a statement that displays the following text: Python’s the best !
print(‘Python’s the best !’)
Write a statement that displays the following text: the cat said “meow.”
print(‘ the cat said “meow”’)
What is a variable?
A name that represents a value in the computers memory
Which of the following are illegal variable names in Python, and why?
x
99bottles
july2009
theSalesFigureForFiscalYear
r&d
grade_report
99bottles because it starts with a number
r&d because variable can only contain letters, numbers, or underscores
Is the variable name Sales the same as sales? Why or why not?
No it is not because python is case sensitve
Is the following assignment statement valid or invalid? If it is valid, why?
72 = amount
no because the variable has to be first
What will the following code display?
val = 99
print ( ‘ The value is ‘, ‘val’)
The value is 99
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?