21
A(n) _____ is always incremented by a constant amount, whereas a(n) _____ is incremented by an amount that varies
A)
accumulator, counter
B)
counter, accumulator
C)
accumulator, accumulator
D)
counter, counter
Answer & Solution
Answer: Option
B
22
The C++ _____ function generates random numbers
A)
generate()
B)
genRand
C)
rand
D)
randGen
E)
srand
Answer & Solution
Answer: Option
E
23
You have declared an integer pointer called point You have also declared an integer called number. Which statement is the correct format?
A)
point = number;
B)
point = *number;
C)
point = &number;
D)
point = +number;
Answer & Solution
Answer: Option
C
24
If you wanted to sort many large objects or structures, it would be most efficient to
A)
place them in an array and sort the array
B)
place pointers to them in an array and sort the array
C)
place them in a linked list and sort the linked list
D)
place references to them in an array and sort the array
Answer & Solution
Answer: Option
B
25
A function that is prototyped as double calculate(int num); may ______
A)
receive a double constant such as 3.9
B)
receive a double variable
C)
either (a) or (b)
D)
neither (a) nor (b)
Answer & Solution
Answer: Option
D
26
The printer can be accessed using the predefined filename _____
A)
printer file
B)
print
C)
cout
D)
PRN, LPT1, etc
Answer & Solution
Answer: Option
D
27
The best functions have _____
A)
high cohesion and tight coupling
B)
high cohesion and loose coupling
C)
low cohesion and tight coupling
D)
low cohesion and loose coupling
Answer & Solution
Answer: Option
B
28
One of the valid escape sequences used in the C language is
A)
\z
B)
\N
C)
\t
D)
\s
E)
None of the above
Answer & Solution
Answer: Option
C
A)
takes no arguments
B)
has default values for all its arguments
C)
either (a) or (b)
D)
neither (a) nor (b)
Answer & Solution
Answer: Option
C
30
Which of the following will increase the value stored in the first element of the fee array by 2?
A)
amount[0] = amount[0] + 2;
B)
amount, fee[0] = amount, fee [0] + 2;
C)
feelnfo.amount[0] = feelnfo.amount[0] + 2;
D)
fee[0].amount = fee[0].amount + 2;
E)
fee.amount[0] = fee.amount[0] + 2;
Answer & Solution
Answer: Option
D