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

QUESTION 13 Using the declaration shown below, _____________ is printed on each

ID: 3708453 • Letter: Q

Question

QUESTION 13

Using the declaration shown below, _____________ is printed on each line
for (int i = 0; i < 2; i++)
{
for(int k = 0; k < 3; k++)
{  
Write(k);
}              
WriteLine( );
}

QUESTION 14

Using the declaration shown below, _____________ lines are printed.
for (int i = 0; i < 2; i++)
{
for(int k = 0; k < 3; k++)
{
Write(k);
   }              
WriteLine( );
}

QUESTION 15

An advantage of sentinel-controlled loops is you do not need to know how many times the loop will be performed.

True

False

Explanation / Answer

a) 012 is printed on each line

Inner loop is printing the number and outer loop is changing the line.

b) Outer loop is changing the line, hence 2 lines will be printed. i from 0 to less than 2.

Then it will be 2 loops and hence 2 lines.

c) True, because you dont know how many times data needs to be processed, but when data is entirely processed you can set the value of senital such that the loop terminates.

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