Quiz 2 Flashcards
A statement that starts with a # symbol is called a:
A) Comment
B) Function
*C) Preprocessor directive
D) Key word
E) None of the above
The ________ is/are used to display information on the computer’s screen.
A) Opening and closing braces
B) Opening and closing quotation marks
*C) cout object
D) Backslash
E) None of the above
The ________ causes the contents of another file to be inserted into a program.
A) Backslash
B) Forwardslash
C) Semicolon
*D) #include directive
E) None of the above
These are data items whose values do not change while the program is running.
*A) Literals
B) Variables
C) Comments
D) Integers
E) None of the above
You must have a ________ for every variable you intend to use in a program.
A) purpose
*B) definition
C) comment
D) constant
E) None of the above
A character literal is enclosed in ________ quotation marks, whereas a string literal is enclosed in ________ quotation marks.
A) double, single
B) triple, double
C) open, closed
*D) single, double
E) None of the above
Which data type typically requires only one byte of storage?
A) short
B) int
C) float
*D) char
E) double
In programming terms, a group of characters inside a set of quotation marks is called a(n):
*A) String literal
B) Variable
C) Operation
D) Statement
E) None of the above
This is used to mark the end of a complete C++ programming statement.
A) Pound Sign
*B) Semicolon
C) Data type
D) Void
E) None of the above
Which character signifies the beginning of an escape sequence?
A) //
B) /
*C) \
D) #
E) {
________ must be included in any program that uses the cout object.
A) Opening and closing braces
*B) The header file iostream
C) Comments
D) Escape sequences
E) None of the above
This function in C++ allows you to identify how many bytes of storage on your computer system an integer data value requires.
A) len
B) bytes
C) f(x)
D) int
*E) sizeof
A variable whose value can be either true or false is of this data type.
A) binary
*B) bool
C) T/F
D) float
E) None of the above
Which of the following correctly consolidates the following declaration statements into one statement?
int x = 7; int y = 16; int z = 28;
A) int x = 7; y = 16; z = 28;
B) int x = 7 y = 16 z = 28;
C) int x, y, z = 7, 16, 28
*D) int x = 7, y = 16, z = 28;
E) None of these will work.
A variable’s ________ is the part of the program that has access to the variable.
A) data type
B) value
*C) scope
D) reach
E) None of the above