NEW
Font size
WorksheetsCSCI Exam 2 Study Guide
Total questions: 55
Worksheet time: 28mins
A ________-controlled loop uses a true/false condition to control the number
of times that it repeats.
Boolean
condition
decision
count
A _______-controlled loop repeats a specific number of times
Boolean
condition
decision
count
Each repetition of a loop is known as a(n)
cycle
revolution
orbit
iteration
The while loop is a _______ type of loop.
pretest
no-test
prequalified
post-iterative
A(n) ______ loop has no way of ending and repeats until the program is
interrupted
indeterminate
interminable
infinite
timeless
The -= operator is an example of a(n) ______ operator.
relational
augmented assignment
complex assignment
reverse allignment
A(n) ______ variable keeps a running total
sentinel
sum
total
accumulator
A(n)_______ is a special value that signals when there are no more items
from a list of items to be processed. This value cannot be mistaken as an item
from the list
sentinel
flag
signal
accumulator
GIGO stands for
great input, great output
garbage in, garbage out
GIGahertz Output
GIGabyte Operation
The integrity of a program’s output is only as good as the integrity of the
program’s
compiler
programming language
input
debugger
The input operation that appears just before a validation loop is known as the
Validation loops are also known as
error traps
error avoidance loops
defensive loops
A condition-controlled loop always repeats a specific number of times.
True
False
The while loop is a pretest loop.
True
False
The following statement subtracts 1 from x: x = x − 1
True
False
It is not necessary to initialize accumulator variables.
True
False
In a nested loop, the inner loop goes through all of its iterations for every single
iteration of the outer loop
True
False
To calculate the total number of iterations of a nested loop, add the number of
iterations of all the loops
True
False
The process of input validation works as follows: when the user of a program
enters invalid data, the program should ask the user “Are you sure you meant to
enter that?” If the user answers “yes,” the program should accept the data
True
False
A group of statements that exist within a program for the purpose of performing a specific task
is a(n) __________
Block
Parameter
Function
Expression
A design technique that helps to reduce the duplication of code within a program and is a
benefit of using functions is __________.
code reuse
divide and conquer
debugging
facilitation of network
The first line of a function definition is known as the __________.
Body
Introduction
Initialization
Header
You __________ a function to execute it
define
call
import
export
A design technique that programmers use to break down an algorithm into functions is known
as __________
top-down design
code simplification
code refractoring
hierarchical subtasking
A __________ is a diagram that gives a visual representation of the relationships between
functions in a program.
flowchart
function relationship chart
symbol chart
hierarchical chart
The _____________ keyword is ignored by the Python interpreter and can be used as a
placeholder for code that will be written later
placeholder
pass
pause
skip
A __________ is a variable that is created inside a function.
global variable
local variable
hidden variable
none of the above; you cannot create a variable inside a function
A(n) ________ is the part of a program in which a variable may be accessed
declaration space
area of visibility
scope
mode
A(n) __________ is a piece of data that is sent into a function.
Argument
Parameter
Header
Packet
A(n) __________ is a special variable that receives a piece of data when a function is called
Argument
Parameter
Header
Packet
A variable that is visible to every function in a program file is a __________.
When possible, you should avoid using __________ variables in a program.
This is a prewritten function that is built into a programming language.
standard function
library function
custom function
cafeteria function
This standard library function returns a random integer within a specified range of values.
random
randint
random_integer
uniform
This standard library function returns a random floating-point number in the range of 0.0 up to
1.0 (but not including 1.0)
random
randint
random_integer
Uniform
This standard library function returns a random floating-point number within a specified range
of values
random
randint
random_integer
uniform
This statement causes a function to end and sends a value back to the part of the program that
called the function.
end
send
exit
return
This is a design tool that describes the input, processing, and output of a function
hierarchy chart
IPO chart
datagram chart
data processing chart
This type of function returns either True or False.
Binary
True_false
Boolean
Logical
This is a math module function.
This is a math module function.
factor
sqrt
differentiate
The phrase “divide and conquer” means that all of the programmers on a team should be
divided and work in isolation.
True
False
Functions make it easier for programmers to work in teams.
True
False
Function names should be as short as possible.
True
False
Calling a function and defining a function mean the same thing.
True
False
A flowchart shows the hierarchical relationships between functions in a program.
True
False
A hierarchy chart does not show the steps that are taken inside a function.
True
False
A statement in one function can access a local variable in another function.
True
False
In Python, you cannot write functions that accept multiple arguments.
True
False
In Python, you can specify which parameter an argument should be passed into a function call.
True
False
You cannot have both keyword arguments and non-keyword arguments in a function call.
Some library functions are built into the Python interpreter.
True
False
You do not need to have an import statement in a program to use the functions in the random
module
True
False
Complex mathematical expressions can sometimes be simplified by breaking out part of the
expression and putting it in a function
True
False
A function in Python can return more than one value
True
False
IPO charts provide only brief descriptions of a function’s input, processing, and output, but do
not show the specific steps taken in a function
True
False
