The assessment has been submitted. It can be reviewed in
the gradebook on or after 7/3/2016.
Date Taken: 7/19/2016
Time Spent: 2 h , 00 secs
Points Received: 132 / 150 (88%)
Question Type: # Of Questions: # Correct:
...
The assessment has been submitted. It can be reviewed in
the gradebook on or after 7/3/2016.
Date Taken: 7/19/2016
Time Spent: 2 h , 00 secs
Points Received: 132 / 150 (88%)
Question Type: # Of Questions: # Correct:
Multiple Choice 25 22
Week 10 : High-Level Programming Test - Attempt #2
Time Remaining:
Page: 1 2
Page 1
Question 1.1. (TCO 2) A variable declared before and outside all function blocks
_____. (Points : 6)
is visible only in main
is visible to all functions
is visible to all functions except main
is not visible to any functions
Question 2.2. (TCO 2) What is the value of data after the following code executes?
unsigned char data = 0xA5;
data = data & 0xF0; (Points : 6)
0xA0
0xF0
0xF5
0x5A
Question 3.3. (TCO 2) What is wrong with the following switch statement?
switch(x)
{
case 0:
cout << x;
case 2:
cout << 2 / x;
break;
default:
cout << “error”;
break;
} (Points : 6)
The value of x could be something other than 1 or 2.
There is no break statement for case 1.
There is no semicolon after the closing bracket.
All of the above
Question 4.4. (TCO 2) Which looping statement is best if the number of iterations is
known? (Points : 6)
if-else
for
while
do-while
Question 5.5. (TCO 2) Why does this code snippet give a compile error?
int loopCounter = 0;
numberOfScores = 20;
while (loopcounter < numberOfScores)
cout << “\nInside the loop”; (Points : 6)
The value of the control loop control variable does not change the loop body.
The curly brackets are missing around the loop body.
The loopCounter variable is not spelled consistently.
All of the above
Question 6.6. (TCO 2) What is the declaration for a C-style string that can hold a name with
up to three printable characters (e.g., “Ron”)? (Points : 6)
int name [3];
char name [3]
int name [4];
char name [4];
Question 7.7. (TCO 2) How many elements does the following array contain?
double data [100] [500]; (Points : 6)
500
100
600
50,000
[Show More]