Chapter 2 checkpoint questions Flashcards
What is a software requirement?
A single function 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 a task
What is pseudocode?
An informal language that has no syntax rules and is not meant to be compiled or executed. Instead, programmers use pseudocode to create models, or “mock-ups”, of programs.
What is a flowchart?
A diagram that graphically depicts the steps that take place in a program
What does the oval symbol mean in a flowchart?
Ovals are terminal symbols.
What does the parallellogram symbol mean in a flowchart?
Parallellograms are either output or input symbols.
What does the rectangle symbol mean in a flowchart?
Rectangles are processing symbols.
Write a statement that displays your name
print(“The name”)
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 references a value in the computer’s memory.
Which of the following are illegal variable names in Python, and why?
x 99bottles july2009 theSalesFigureForFiscalYear r&d grade_report
99bottles is illegal because it begins with a number.
r&d is illegal because the & character is not allowed.
Is the variable name Sales the same as sales? Why or why not?
No, variable names are case sensitive.
Is the following assignment statement valid or invalid? If it is invalid, why?
72 = amount
It is invalid, the variable that is receiving the assignment (in this case ‘amount’) must appear on the left side of the = operator.
What will the following code display?
val = 99
print(‘The value is’, ‘val’)
The value is val