Chapter 2 Multiple choice questions Flashcards
A ______ error does not prevent the program from running, but causes it to produce incorrect results.
a) syntax
b) hardware
c) logic
d) fatal
A logic error – code written with correct syntax but needs debugging because it does not do what was intended.
A ______ is a single function that the program must perform in order to satisfy the customer.
a) task
b) software requirement
c) prerequisite
d) predicate
A software requirement is a single function that the program must perform in order to satisfy the customer.
A(n) ______ is a set of well-defined logical steps that must be taken to perform a task.
a) logarithm
b) plan of action
c) logic schedule
d) algorithm
An algorithm
An informal language that has no syntax rules and is not meant to be compiled or executed is called ______.
a) faux code
b) pseudocode
c) Python
d) a flowchart
Pseudocode is an informal language that has no syntax rules.
A ______ is a diagram that graphically depicts the steps that take place in a program.
a) flowchart
b) step chart
c) code graph
d) program graph
A flowchart graphically depicts the steps that happen in a program.
A ______ is a sequence of characters.
a) char sequence
b) character collection
c) string
d) text block
A sequence of characters is called a string.
A ______ is a name that references a value in the computer’s memory.
a) variable
b) register
c) RAM slot
d) byte
A variable is a name that references a value
A ______ is any hypothetical person using a program and providing input for it.
a) designer
b) user
c) guinea pig
d) test subject
A user
A string literal in Python must be enclosed in ______.
a) parentheses
b) single-quotes
c) double-quotes
d) either single-quotes or double-quotes
A string literal must be enclosed in either single-quotes or double-quotes.
Short notes placed in different parts of a program explaining how those parts of the program work are called
a) comments
b) reference manuals
c) tutorials
d) external documentation
Comments.
A(n) ______ makes a variable reference a value in the computer’s memory.
a) variable declaration
b) assignment statement
c) math expression
d) string literal
A variable declaration.
This symbol marks the beginning of a comment in Python.
a) &
b) *
c) **
d) #
marks the beginning of a comment in Python.
Which of the following statements will cause an error?
a) x = 17
b) 17 = x
c) x = 9999
d) x = ‘17’
17 = x
A variable must be declared on the left, and variable names cannot begin with numbers.
In the expression 12 + 7, the values on the right and left of the + symbol are called ______.
a) operands
b) operators
c) arguments
d) math expressions
-The values on the left and right of the operator (+) are called operands.
(The full equation, 12 + 7, is called a math expression.)
This operator performs integer division.
a) //
b) &
c) **
d) /
/