1.
cin»_space; age»_space; pay»_space; section;
A)
cin»_space; description;
B)
getline (cin,description);
3. What header files must be included in the following program?
int main()
{
double amount = 89.7;
cout << showpoint << fixed;
cout << setw(8) << amount << endl;
return 0;
}#include #include
28 / 4 - 2 6 + 12 * 2 - 8 4 + 8 * 2 6 + 17 % 3 - 2 2 + 22 * (9 - 7) (8 + 7) * 2 (16 + 7) % 2 - 1 12 / (10 - 6) (19 - 3) * (2 + 2) / 4
5 22 20 6 46 30 0 3 16
c
7. Assume a program has the following variable de nitions: int a, b = 2; float c = 4.2; and the following statement: a = b * c; What value will be stored in a? A) 8.4 B) 8 C) 0 D) None of the above
b
unitsEach = static_cast(qty)/salesReps;
9.
const int RATE = 12;
10 Complete the following table by writing statements with combined assignment operators
in the right-hand column. The statements should be equivalent to the statements
in the left-hand column.
x = x + 5; total = total + subtotal; dist = dist / rep; ppl = ppl * period; inv = inv - shrinkage; num = num % 2;
x +=5; total +=subtotal; dist/=rep; ppl*=period; inv-=shrinkage; num%=2
11. Write a multiple assignment statement that can be used instead of the following group of assignment statements: east = 1; west = 1; north = 1; south = 1;
east = west = north = south = 1;
cout
13.
cout «_space;setw(12) «_space;fixed
«_space;setprecision(4) «_space;totalAge;
cout
cos
sin
tan
exp
fmod
log
log10
pow
sqrt
include