C++
The ______ is/are used to display information on the computer's screen.
Cout object
Numeric data types in C++ have unlimited ranges.
False
Every complete C++ Program must have a _____
Function named main
The numeric data types in C++ can be broken into two general categories:
Integer and Floating Point
A statement that starts with a # is called a
Preprocessor directive
For every opening brace in a C++ program, there must be a
Closing Brace
To output multiple lines of text to the user, you must use more than one cout statement.
False
You do not need to pay attention to capitalization in C++, since variable names are not case sensitive.
False
These are used to declare variables that can hold real numbers.
Floating point data types
What will the following code display? cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << end;
Four score and seven years ago
What will the following code display? cout << "Four" << " score" << end; cout << "and" << " seven" << end; cout << "years" << " ago" << end;
Fourscore andseven yearsago
These are data items whose values do not change while the program is running.
Literals
What is a valid C++ identifier?
Only Alphabets,Digits and Underscores are permitted. Identifier name cannot start with a digit. Key words cannot be used as a name. Upper case and lower case letters are distinct. Special Characters are not allowed. Global Identifier cannot be used as "Identifier".
This is used to mark the end of a complete C++ programming statement.
Semicolon
Character constants in C++ are always enclosed in _____.
Single quotation marks
A character literal is enclosed in ________ quotation marks, whereas a string literal is enclosed in ________ quotation marks.
Single, Double
In a C++ program, two slash marks (//) indicate
The beginning of a comment
____________ must be included in any program that uses the cout object.
The header file iostream
What will the following code display? int number = 7; cout << "The number is " << "number" << endl;
The number is number
All variables in C++ must be declared before they are used within the program.
True
Enumerated data types allow a programmer to create a new, simple data type of their own.
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
_____________ represent storage locations in the computer's memory.
Variables
Which escape sequence causes the cursor to move to the beginning of the next line?
\n
Legal Variable?
abc123
Which of the following defines a double-precision floating point variable named payCheck?
double payCheck;
The end of a printed line can be signaled by sending _____ to the cout object
endl
How would you consolidate the following declaration statements into one statement? int x = 7; int y = 16; int z = 28;
int x = 7, y = 16, z = 28;
Which one of the following would be an illegal variable name?
long
How would you consolidate the following declaration statements into one statement? short a = 1; short a = 5; short a = 7;
short a = 1, b = 5, c = 7;
The float data type is considered _____ precision, and the double data type is considered _____ precision.
single, double
Including the following namespace will allow you simplify you code.
std
The C++ language requires that you give variables names that indicate what the variables are used for.
False
What will the following code display? int x = 0, y = 1, z = 2; cout << x << y << z << endl;
012
Illegal Variable?
3dGraph
The = operator means _____, not mathematical equality.
Assignment
You must have a ___________ for every variable you intend to use in a program.
Definiton
The amount of memory used by the data type int is _____ the amount of memory used by the data type unsigned int.
Equal to
A variable called "average" should be declared as an integer data type because it will probably hold data that contains decimal places.
False