CS Quiz 2
Consider the following code. // Insertion Point 1 using namespace std; const float PI = 3.14; int main() { //Insertion Point 2 float r = 2.0; float area; area = PI * r * r; cout << "Area = " << area <<endl; return 0; } // Insertion Point 3 In this code, where does the include statement belong?
Insertion Point 1
Which of the following is a legal identifier?
program_1
The ___ rules of a programming language tell you which statements are legal, or accepted by the programming language
syntax
A comma is also called a statement terminator.
False
An operator that has only one operand is called a unique operator.
False
In C++, reserved words are the same as predefined identifiers
False
The escape sequence \r moves the insertion point to the beginning of the next line
False
Suppose that a = 5. After the execution of the statement ++a; the value of a is 6
True
Which of the following is the newline character?
\n
___ is a valid char value
'A'
Suppose that count is an int variable and count = 1. After the statement count++; executes, the value of count is ___
2
The value of the expression 17 % 7 is ___
3
The value of the expression 33/10, assuming both values are integral data types, is ___
3
___ is a valid int value
46259
The expression static_cast<int>(9.9) evaluates to ___
9
Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, ___
alpha = 50
Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ___
alpha = beta
Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ___
beta = beta -1;
Which of the following is a reserved word in C++?
char
An example of a floating point data type is ___
double