wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSCI Exam 2 Study Guide

Total questions: 55

Worksheet time: 28mins

Name
Class
Date
1.

A ________-controlled loop uses a true/false condition to control the number
of times that it repeats.

a)

Boolean

b)

condition

c)

decision

d)

count

2.

A _______-controlled loop repeats a specific number of times

a)

Boolean

b)

condition

c)

decision

d)

count

3.

Each repetition of a loop is known as a(n)

a)

cycle

b)

revolution

c)

orbit

d)

iteration

4.

The while loop is a _______ type of loop.

a)

pretest

b)

no-test

c)

prequalified

d)

post-iterative

5.

A(n) ______ loop has no way of ending and repeats until the program is
interrupted

a)

indeterminate

b)

interminable

c)

infinite

d)

timeless

6.

The -= operator is an example of a(n) ______ operator.

a)

relational

b)

augmented assignment

c)

complex assignment

d)

reverse allignment

7.

A(n) ______ variable keeps a running total

a)

sentinel

b)

sum

c)

total

d)

accumulator

8.

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

a)

sentinel

b)

flag

c)

signal

d)

accumulator

9.

GIGO stands for

a)

great input, great output

b)

garbage in, garbage out

c)

GIGahertz Output

d)

GIGabyte Operation

10.


The integrity of a program’s output is only as good as the integrity of the
program’s

a)

compiler

b)

programming language

c)

input

d)

debugger

11.

The input operation that appears just before a validation loop is known as the

a)
post-validation input
b)
user input operation
c)
pre-validation input
d)
initialization input
12.

Validation loops are also known as

a)

error traps

b)
output validation loops
c)

error avoidance loops

d)

defensive loops

13.

A condition-controlled loop always repeats a specific number of times.

a)

True

b)

False

14.

The while loop is a pretest loop.

a)

True

b)

False

15.

The following statement subtracts 1 from x: x = x − 1

a)

True

b)

False

16.

It is not necessary to initialize accumulator variables.

a)

True

b)

False

17.

In a nested loop, the inner loop goes through all of its iterations for every single
iteration of the outer loop

a)

True

b)

False

18.

To calculate the total number of iterations of a nested loop, add the number of
iterations of all the loops

a)

True

b)

False

19.

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

a)

True

b)

False

20.

A group of statements that exist within a program for the purpose of performing a specific task
is a(n) __________

a)

Block

b)

Parameter

c)

Function

d)

Expression

21.

A design technique that helps to reduce the duplication of code within a program and is a
benefit of using functions is __________.

a)

code reuse

b)

divide and conquer

c)

debugging

d)

facilitation of network

22.

The first line of a function definition is known as the __________.

a)

Body

b)

Introduction

c)

Initialization

d)

Header

23.

You __________ a function to execute it

a)

define

b)

call

c)

import

d)

export

24.

A design technique that programmers use to break down an algorithm into functions is known
as __________

a)

top-down design

b)

code simplification

c)

code refractoring

d)

hierarchical subtasking

25.

A __________ is a diagram that gives a visual representation of the relationships between
functions in a program.

a)

flowchart

b)

function relationship chart

c)

symbol chart

d)

hierarchical chart

26.

The _____________ keyword is ignored by the Python interpreter and can be used as a
placeholder for code that will be written later

a)

placeholder

b)

pass

c)

pause

d)

skip

27.

A __________ is a variable that is created inside a function.

a)

global variable

b)

local variable

c)

hidden variable

d)

none of the above; you cannot create a variable inside a function

28.

A(n) ________ is the part of a program in which a variable may be accessed

a)

declaration space

b)

area of visibility

c)

scope

d)

mode

29.


A(n) __________ is a piece of data that is sent into a function.

a)

Argument

b)

Parameter

c)

Header

d)

Packet

30.


A(n) __________ is a special variable that receives a piece of data when a function is called

a)

Argument

b)

Parameter

c)

Header

d)

Packet

31.

A variable that is visible to every function in a program file is a __________.

a)
static variable
b)
constant variable
c)
local variable
d)
global variable
32.

When possible, you should avoid using __________ variables in a program.

a)
local
b)
global
c)
static
d)
constant
33.

This is a prewritten function that is built into a programming language.

a)

standard function

b)

library function

c)

custom function

d)

cafeteria function

34.

This standard library function returns a random integer within a specified range of values.

a)

random

b)

randint

c)

random_integer

d)

uniform

35.

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)

a)

random

b)

randint

c)

random_integer

d)

Uniform

36.

This standard library function returns a random floating-point number within a specified range
of values

a)

random

b)

randint

c)

random_integer

d)

uniform

37.

This statement causes a function to end and sends a value back to the part of the program that
called the function.

a)

end

b)

send

c)

exit

d)

return

38.


This is a design tool that describes the input, processing, and output of a function

a)

hierarchy chart

b)

IPO chart

c)

datagram chart

d)

data processing chart

39.

This type of function returns either True or False.

a)

Binary

b)

True_false

c)

Boolean

d)

Logical

40.

This is a math module function.

a)

This is a math module function.

b)

factor

c)

sqrt

d)

differentiate

41.

The phrase “divide and conquer” means that all of the programmers on a team should be
divided and work in isolation.

a)

True

b)

False

42.

Functions make it easier for programmers to work in teams.

a)

True

b)

False

43.

Function names should be as short as possible.

a)

True

b)

False

44.

Calling a function and defining a function mean the same thing.

a)

True

b)

False

45.

A flowchart shows the hierarchical relationships between functions in a program.

a)

True

b)

False

46.

A hierarchy chart does not show the steps that are taken inside a function.

a)

True

b)

False

47.

A statement in one function can access a local variable in another function.

a)

True

b)

False

48.

In Python, you cannot write functions that accept multiple arguments.

a)

True

b)

False

49.

In Python, you can specify which parameter an argument should be passed into a function call.

a)

True

b)

False

50.

You cannot have both keyword arguments and non-keyword arguments in a function call.

a)
False
b)
True
51.

Some library functions are built into the Python interpreter.

a)

True

b)

False

52.


You do not need to have an import statement in a program to use the functions in the random
module

a)

True

b)

False

53.


Complex mathematical expressions can sometimes be simplified by breaking out part of the
expression and putting it in a function

a)

True

b)

False

54.

A function in Python can return more than one value

a)

True

b)

False

55.

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

a)

True

b)

False