CPSC 120 Multiple Choice Questions
and Answers Rated A+
________ are data items whose values cannot change while the program is running. -
ANSWER-Literals
________ can be used to override the rules of operator precedence. - ANSWER-
Parentheses
________ causes a program to wait until information is typed at the keyboard and the
Enter key is pressed. - ANSWER-The cin object
________ is an example of volatile memory, used for temporary storage while a
program is running.
A hard disk - ANSWER-RAM
________ is used in a C++ program to mark the end of a statement, or to separate
items in a list. - ANSWER-Punctuation
________ must be included in a program in order to use the cout object. - ANSWER-
The iostream header file
A ________ is a complete instruction that causes the computer to perform some action.
- ANSWER-statement
A ________ is a program module whose purpose is to test other modules by calling
them. - ANSWER-driver
A ________ is used to mark the end of a complete C++ programming statement. -
ANSWER-semicolon
A ________ variable can hold only one of two values: true or false. - ANSWER-bool
A ________ variable is defined inside the body of a function and is not accessible
outside that function. - ANSWER-local
A C++ character literal is enclosed in ________ quotation marks, whereas a string literal
is enclosed in ________ quotation marks. - ANSWER-single, double
A flag is a variable, usually of data type ________, that signals whether or not some
condition exists. - ANSWER-bool
A for statement contains three expressions: initialization, test, and - ANSWER-update.
, A function ________ includes the statements that make up the function. - ANSWER-
definition
A function other than the main function is executed - ANSWER-whenever it is called.
A sentinel is a special value that - ANSWER-marks the end of a list of values.
A set of well-defined steps for performing a task or solving a problem is known as -
ANSWER-an algorithm.
A software package that includes a text editor, compiler, debugger, and assorted utilities
for creating, testing, and running software is called - ANSWER-none of these.
A storage location in the computer's memory that can hold a piece of data is called -
ANSWER-a variable.
A trailing else placed at the end of an if/else if statement provides a default action when
________ of the if conditions is/are true. - ANSWER-none
A two-dimensional array can be viewed as - ANSWER-a table with rows and columns.
A variable definition always specifies the name of a variable and tells - ANSWER-what
type of data it can hold.
A variable must be defined - ANSWER-before it can be used.
A variable that keeps a running total of data values is called a(n) - ANSWER-
accumulator.
A void function is one that - ANSWER-returns no value.
A(n) ________ is a set of instructions that tells the computer how to solve a problem. -
ANSWER-program
A(n) ________ is a variable, usually a bool, that signals when a condition exists. -
ANSWER-flag
An integrated development environment (IDE) normally includes - ANSWER-all of these
(a compiler, a debugger, a text editor)
An operation that copies a value into a variable is called a(n) ________ operation. -
ANSWER-assignment
At the heart of a computer is its central processing unit (CPU). Its job is to - ANSWER-
do all of these. (produce some result, fetch instructions, carry out the operations
commanded by the instructions).
and Answers Rated A+
________ are data items whose values cannot change while the program is running. -
ANSWER-Literals
________ can be used to override the rules of operator precedence. - ANSWER-
Parentheses
________ causes a program to wait until information is typed at the keyboard and the
Enter key is pressed. - ANSWER-The cin object
________ is an example of volatile memory, used for temporary storage while a
program is running.
A hard disk - ANSWER-RAM
________ is used in a C++ program to mark the end of a statement, or to separate
items in a list. - ANSWER-Punctuation
________ must be included in a program in order to use the cout object. - ANSWER-
The iostream header file
A ________ is a complete instruction that causes the computer to perform some action.
- ANSWER-statement
A ________ is a program module whose purpose is to test other modules by calling
them. - ANSWER-driver
A ________ is used to mark the end of a complete C++ programming statement. -
ANSWER-semicolon
A ________ variable can hold only one of two values: true or false. - ANSWER-bool
A ________ variable is defined inside the body of a function and is not accessible
outside that function. - ANSWER-local
A C++ character literal is enclosed in ________ quotation marks, whereas a string literal
is enclosed in ________ quotation marks. - ANSWER-single, double
A flag is a variable, usually of data type ________, that signals whether or not some
condition exists. - ANSWER-bool
A for statement contains three expressions: initialization, test, and - ANSWER-update.
, A function ________ includes the statements that make up the function. - ANSWER-
definition
A function other than the main function is executed - ANSWER-whenever it is called.
A sentinel is a special value that - ANSWER-marks the end of a list of values.
A set of well-defined steps for performing a task or solving a problem is known as -
ANSWER-an algorithm.
A software package that includes a text editor, compiler, debugger, and assorted utilities
for creating, testing, and running software is called - ANSWER-none of these.
A storage location in the computer's memory that can hold a piece of data is called -
ANSWER-a variable.
A trailing else placed at the end of an if/else if statement provides a default action when
________ of the if conditions is/are true. - ANSWER-none
A two-dimensional array can be viewed as - ANSWER-a table with rows and columns.
A variable definition always specifies the name of a variable and tells - ANSWER-what
type of data it can hold.
A variable must be defined - ANSWER-before it can be used.
A variable that keeps a running total of data values is called a(n) - ANSWER-
accumulator.
A void function is one that - ANSWER-returns no value.
A(n) ________ is a set of instructions that tells the computer how to solve a problem. -
ANSWER-program
A(n) ________ is a variable, usually a bool, that signals when a condition exists. -
ANSWER-flag
An integrated development environment (IDE) normally includes - ANSWER-all of these
(a compiler, a debugger, a text editor)
An operation that copies a value into a variable is called a(n) ________ operation. -
ANSWER-assignment
At the heart of a computer is its central processing unit (CPU). Its job is to - ANSWER-
do all of these. (produce some result, fetch instructions, carry out the operations
commanded by the instructions).