Quiz 2 Flashcards
(39 cards)
The expression static_cast<int>(6.9) + static_cast<int>(7.9) evaluates to \_\_\_\_.</int></int>
A) 13
B) 14
C) 14.8
D) 15
13
Which of the following is a legal identifier?
A) program!
B) program_1
C) 1program
D) program 1
Program_1
An example of a floating point data type is ____.
Question options:
A) int
B) char
C) double
D) short
double
Which of the following is a reserved word in C++?
A) char
B) Char
C) CHAR
D) character
char
The expression static_cast<int>(9.9) evaluates to \_\_\_\_.</int>
A) 9
B) 10
C) 9.9
D) 9.0
9
The escape sequence \r moves the insertion point to the beginning of the next line.
A) True
B) False
False
The value of the expression 17 % 7 is ____.
A) 1
B) 2
C) 3
D) 4
3
The maximum number of significant digits in float values is up to 6 or 7.
A) True B) False
True
____ is a valid int value.
A) 46,259
B) 46259
C) 462.59
D) -32.00
B
A mixed arithmetic expression contains all operands of the same type.
A) True B) False
False
A comma is also called a statement terminator.
A) True B) False
False
A(n) ____ is simply a name the programmer assigns to refer to computer storage locations.
A) constant
B) expression
C) variable
D) identifier
variable
A(n) ____ is a word the language sets aside for a special purpose and can be used only in a specified manner.
A) codeword
B) keyword
C) identifier
D) classname
keyword
A ____ contains both data and functions appropriate for manipulating the data.
A) segment
B) block
C) class
D) function
class
The C++ operator ____ provides the number of bytes used to store values for any data type named in the operator’s parentheses.
A) length()
B) size()
C) lengthof()
D) sizeof()
D
____ are explanatory remarks made in a program.
A) Classes
B) Strings
C) Escape sequences
D) Comments
D
____ programs are easier to develop, correct, and modify than programs constructed in some other manner.
A) Handwritten
B) Low-level
C) Modular
D) Sequential
Modular
C++ is a case-sensitive language.
A) True B) False
True
A ____ begins with two slashes (//) and continues to the end of the line.
A) block comment
B) function comment
C) line comment
D) program comment
line comment
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
A) True
B) False
False
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
A) True
B) False
False
The value of the expression 33/10, assuming both values are integral data types, is ____.
A) 0.3
B) 3
C) 3.0
D) 3.3
3
The declaration int a, b, c; is equivalent to which of the following?
A) inta , b, c;
B) int a,b,c;
C) int abc;
D) int a b c;
int a,b,c;
The ____ rules of a programming language tell you which statements are legal, or accepted, by the programming language.
A) semantic
B) logical
C) syntax
D) grammatical
C