COP2000 Quiz 2 Chapter 2
The C++ language requires that you give variables names that indicate what the variables are used for.
False
What will the following code display? cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << endl;
Four score and seven years ago
Besides decimal, two other number systems you might encounter in C++ programs are:
Hexadecimal and Octal
These are data items whose values do not change while the program is running.
Literals
This is used to mark the end of a complete C++ programming statement.
Semicolon
In a C++ program, two slash marks ( // ) indicate:
The beginning of a comment
C++ does not have a built in data type for storing strings of characters.
True
Escape sequences are always stored internally as a single character.
True
When typing in your source code into the computer, you must be very careful since most of your C++ instructions, header files, and variable names are case sensitive.
True
Every complete C++ program must have a _____________.
function named main
How would you consolidate the following declaration statements into one statement?
int x = 7, y = 16, z = 28;
The float data type is considered _____ precision, and the double data type is considered _______ precision.
single, double
The _____ causes the contents of another file to be inserted into a program.
#include directive
What is the modulus operator?
%
Character constants in C++ are always enclosed in ______.
'single quotation marks'
What will the value of x be after the following statements execute? int x; x = 18 % 4;
2
What will the value of x be after the following statements execute? int x; x = 18 / 4;
4
Of the following, which is a valid C++ identifier?
All of these are valid identifiers.