chapter 2 cs180
___________ is a valid char value
'A'
in a c++ program _________ are used to separate special symbols, reserved words, and identifiers
whitespaces
the expressioin static_cast<int>(9.9) evaluates to
9
which of the following is the newline character
\n
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 statements
alpha = beta; beta = beta + 1;
In C++, reserved words are the same as predefined identifiers.
false
a comma is also a statement terminator
false
the escape sequence \r moves the insertion point to the beginning of the next line
false
an operator that has only one operand is called a unique operator
false e
_______ functions are those that have already been written and are provided as part of the system
predefined
when a value of one data type is automatically changed to another data type ____________coercion is said to have occured
implicit
___________ is the process of planning and creating a program
programming
____ are executable statements that inform the user what to do.
prompt lines
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin >> one >> two; executes, ____.
one = 10.5, two = 30.6
The expression static_cast<int>(6.9) + static_cast<int>(7.9) evaluates to ____.
13
the length of the string "computer science" is __
16
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 33/10, assuming both values are integral data types, is ____.
3
the value of the expression 17 % 7 is ______
3
the memory allocated for a float value is _______ bytes
4
a ________ is a memory location whose contents can be changed
variable
an example of a floating point data type is
double
________ is a valid int value
46259
suppose that alpha and beta are int variables. the statement alpha = ++ beta; is equivalent to the statements
beta = beta + 1; alpha = beta;
suppose that alpha and beta are int variables. the statement alpha = --beta; is equivalent to the statement
beta = beta -1 alpha = beta
which of the following is a reserved word in c++
char
_________ can be used to identify the authors of the program, give the date when the program is written or modified, give a brief explanation of the program and explain the meaning of the key statements in a program
comments
the memory space for a __________ data value is 4 bytes
float and int
a ______ is a sequence of zero or more characters
string
Suppose that alpha and beta are int variables. The statement alpha = --beta; is equivalent to the statement(s) ____.
alpha = beta; beta = beta - 1;
the ___________ type is c++ method for allowing programmers to create their own simple data types
enummeration
A mixed arithmetic expression contains all operands of the same type.
false
a ___________ is a collection of statements and when it is activated, or executed, it accomplishes something
function or subprogram
which of the following is a legal identifier
program_1
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 where does the include statement below
insertion point 1
The declaration int a, b, c; is equivalent to which of the following?
int a,b,c;
In C++, you can use a(n) ____________________ to instruct a program to mark those memory locations in which data is fixed throughout program execution.
named constant
the maximum number of significant digits is called the
precision
__________ rules determine the meaning of instructions
semantic
A data type is called ____________________ if the variable or named constant of that type can store only one value at a time.
simple data type
suppose that sum and num are int variables and sum = 5 and num = 10. after the statement sum +=num executes
sum = 15
Choose the output of the following C++ statement: cout << "Sunny " << '\n' << "Day " << endl;
sunny day
the _______ rules of a programming language tell you which statements are legal or accepted, by the programming language
syntax
smallest unit in a program in any language is
token
If a C++ arithmetic expression has no parentheses, operators are evaluated from left to right.
true
Suppose a = 5. After the execution of the statement ++a; the value of a is 6.
true
suppose we declare a variable is a sum as an int. the statement sum += 7 is equivalent to the statement sum = sum + 7
true
the maximum number of significant digits in float values is up to 6 to 7
true
the maximum number of significant digits in values of the double type is 15
true