Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

3. (TCO 10) For readability, all statements inside a loop body should be (Points

ID: 3648133 • Letter: 3

Question

3. (TCO 10) For readability, all statements inside a loop body should be (Points : 5)
indented the same distance as the loop control statement.
indented by one additional tab stop more than the loop control statement.
surrounded by an open and closing parenthesis.
written on the same line.


4.
(TCO 3) What is the value of beta after the following code executes if the input is 5?

int beta;
cin >> beta;
switch(beta)
{
case 5:
beta += 5;
case 1:
beta++;
case 5:
beta += 5;
break;
case 4:
beta += 4;
} (Points : 5)
16
11
7
20


5.
(TCO 4) How many times does the following loop body execute?

int count = 52;
for(int i = 0; i < count; i++)
{
cout << count << endl;
--count;
} (Points : 5)
26
52
25
None of the above


6. (TCO 8) Statements in your code which do not adhere to the syntax rules of the language lead to (Points : 5)
runtime errors.
linker errors.
compiler errors.
All of the above


7. (TCO 8) When a program is stopped at a breakpoint, you can use the debugger to (Points : 5)
examine program variables.
change the value of program variables.
set new breakpoints or clear existing breakpoints.
All of the above


8. (TCO 9) White box testing (Points : 5)
is done without any knowledge of how a program was implemented.
requires knowledge of the structure of the program code.
is not concerned with testing every execution path through the program code.
None of the above


9. (TCO 9) Which of the following statements about testing are true? (Points : 5)
Black box test cases can be written as soon as the problem statement and program requirements are specified.
White box testing is typically done by the programmer as code is being developed.
Both black box and white box testing are commonly done to fully test a program.
All of the above



10. (TCO 5) When a variable is passed by reference as a function argument, (Points : 5)
its value is copied
it can have its value both read and modified by the function
it is protected from being modified by the function
All of the above


11. (TCO 5) Which of the following techniques can be used by a function to return two results to the calling function? (Points : 5)
Use two return statements: return ( value1 ); return ( value2 );
Use one return statement with two values: return ( value1, value2 );
Use two reference parameters and assign the two results to those reference parameters.
Not allowed in C++


12. (TCO 6) An array is a data type that contains _______. (Points : 5)
a fixed number of elements
a set of values all of which are of the same type
values that must either be initialized when the array is declared or assigned at runtime
All of the above


Explanation / Answer

3. (TCO 10) For readability, all statements inside a loop body should be (Points : 5)
indented the same distance as the loop control statement.
indented by one additional tab stop more than the loop control statement.
surrounded by an open and closing parenthesis.
written on the same line.


4.
(TCO 3) What is the value of beta after the following code executes if the input is 5?

int beta;
cin >> beta;
switch(beta)
{
case 5:
beta += 5;
case 1:
beta++;
case 5:
beta += 5;
break;
case 4:
beta += 4;
} (Points : 5)

5+5+1+5 break =>16

16 (in reality, your compiler would not run this code since you used the case 5 label twice)
11
7
20


5.
(TCO 4) How many times does the following loop body execute?

int count = 52;
for(int i = 0; i < count; i++)
{
cout << count << endl;
--count;
} (Points : 5)
26
52
25
None of the above


6. (TCO 8) Statements in your code which do not adhere to the syntax rules of the language lead to (Points : 5)
runtime errors.
linker errors.
compiler errors.
All of the above


7. (TCO 8) When a program is stopped at a breakpoint, you can use the debugger to (Points : 5)
examine program variables.
change the value of program variables.
set new breakpoints or clear existing breakpoints.
All of the above


8. (TCO 9) White box testing (Points : 5)
is done without any knowledge of how a program was implemented.
requires knowledge of the structure of the program code.
is not concerned with testing every execution path through the program code.
None of the above


9. (TCO 9) Which of the following statements about testing are true? (Points : 5)
Black box test cases can be written as soon as the problem statement and program requirements are specified.
White box testing is typically done by the programmer as code is being developed.
Both black box and white box testing are commonly done to fully test a program.
All of the above



10. (TCO 5) When a variable is passed by reference as a function argument, (Points : 5)
its value is copied
it can have its value both read and modified by the function
it is protected from being modified by the function
All of the above


11. (TCO 5) Which of the following techniques can be used by a function to return two results to the calling function? (Points : 5)
Use two return statements: return ( value1 ); return ( value2 );
Use one return statement with two values: return ( value1, value2 );
Use two reference parameters and assign the two results to those reference parameters.
Not allowed in C++


12. (TCO 6) An array is a data type that contains _______. (Points : 5)
a fixed number of elements
a set of values all of which are of the same type
values that must either be initialized when the array is declared or assigned at runtime
All of the above

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote