chapter 2 Flashcards

1
Q

Who is a programmer’s customer?

A

A person, group, or organization that is asking you to write a program

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

What is a software requirement?

A

A task 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

What is an algorithm?

A

A set of well-defined logical steps that must be taken to perform the task

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

What is a pseudocode?

A

An informal language that has no syntax rules and is not meant to be compiled or executed. It is used for designing only purposes.

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

What is a flowchart?

A

A diagram that graphically depicts the steps that take place in a program.

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

What do each of the following symbols mean in a flowchart?
- Oval
- Parallelogram
- Rectangle

A
  • Oval = start and/or the end of a program
  • Parallelogram = input/output
  • Rectangle = Processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Write a statement that displays your name

A

print(‘Gabriela Quihuis’)

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

Write a statement that displays the following text: Python’s the best !

A

print(‘Python’s the best !’)

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

Write a statement that displays the following text: the cat said “meow.”

A

print(‘ the cat said “meow”’)

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

What is a variable?

A

A name that represents a value in the computers memory

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

Which of the following are illegal variable names in Python, and why?
x
99bottles
july2009
theSalesFigureForFiscalYear
r&d
grade_report

A

99bottles because it starts with a number
r&d because variable can only contain letters, numbers, or underscores

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

Is the variable name Sales the same as sales? Why or why not?

A

No it is not because python is case sensitve

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

Is the following assignment statement valid or invalid? If it is valid, why?
72 = amount

A

no because the variable has to be first

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

What will the following code display?
val = 99
print ( ‘ The value is ‘, ‘val’)

A

The value is 99

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

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?

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

What will be displayed by the following program?
my_value=99
my_value=0
print(my_value)

A
17
Q

You need the user of a program to enter a customer’s last name. Write a statement that prompts the user to enter this data and assigns the input to a variable

A
18
Q

You need the user of a program to enter the amount of sales for the week. Write a statement that prompts the user to enter this data and assigns the input to a variable.

A
19
Q

What is the program development cycle?

A
  • Design the program
  • Write the code
  • Correct syntax errors
  • Test the program
  • Correct logic errors