True/False Indicate whether the
statement is true or false.
|
|
|
1.
|
The C++ integer data types are used for storing real numbers.
|
|
|
2.
|
If no value is assigned to a numeric variable when it is declared, the compiler
automatically sets it to a value of zero.
|
|
|
3.
|
Variables must be declared at the beginning of a function or before the first
function in the program, and cannot be declared following any program code statements.
|
|
|
4.
|
Multiple variables can be declared in a single program statement as long as they
are all of the same data type.
|
|
|
5.
|
Alphabetic characters are stored internally in a computer as a numeric
value.
|
Multiple Choice Identify the
choice that best completes the statement or answers the question.
|
|
|
6.
|
What name is used to describe an area of a program that is used to store data
that cannot be changed while the program is running?
a. | fixture | c. | variable | b. | constant | d. | container |
|
|
|
7.
|
What term is used to describe the process of assigning a name to a variable and
telling the compiler what data type to use for the variable?
a. | assigning a variable | c. | declaring a variable | b. | designating a variable | d. | variable
generation |
|
|
|
8.
|
Which statement below shows the correct syntax for declaring a variable named
cost with a data type of long, and an initial value of 57.650?
a. | cost type = long, value = 57.650; | c. | long
cost:57.650; | b. | long cost,57.650 ; | d. | long cost = 57.650; |
|
|
|
9.
|
Which of the following rules is true when it comes to assigning a name to a
variable?
a. | variable names can contain spaces | b. | a variable name can start with a
number | c. | a variable name can start with an underscore | d. | all of the
above |
|
|
|
10.
|
What is the name of the code used by most computers to assign numeric values to
characters?
a. | ASCAP | c. | ASCDR | b. | ASCII | d. | ASNUM |
|
|
|
11.
|
What name is used to describe a group of characters used together in a program
to form a word or a sentence?
a. | block | c. | string | b. | set | d. | phrase |
|
|
|
12.
|
What keyword is used to define a constant value in a program?
a. | constant | c. | con | b. | cons | d. | const |
|
Completion Complete each
statement.
|
|
|
13.
|
A(n) ____________________ is a named location in a program that is used to store
data that can be accessed and modified while the program is executing.
|
|
|
14.
|
The process of assigning a value to a variable when it is declared is called
____________________ the variable.
|
|
|
15.
|
The C++ language is ____________________ and variables named price, and
Price, would be treated as separate variables.
|
|
|
16.
|
The C++ ____________________ data type can hold only one of two values, one that
represents True or a value that represents False.
|