Counter-controlled while loop


Assignment:

Figure out counter controlled while loop. Write a counter-controlled while loop that uses the loop control variable to take on the values 0 and 10. How do I initialize the loop control variable before the program enters the loop?

In the boy of the loop, multiply the value of the loop control variable by 10 and by 100, then change the value of the loop control variable in the body of the loop.

String head1 = "Number: ";
String head2 = "Multiplied by 10: ";
String head3 = "Multiplied by 100: ";
int numberCounter; // Numbers 0 through 10.
int byTen; // Stores the number multiplied by 10.
int byHundred; // Stores the number multiplied by 100.
final int NUM_LOOPS = 10; // Constant used to control loop.

// This is the work done in the housekeeping() method
System.out.println("0 through 10 multiplied by 10 and by 100" + "n");

// This is the work done in the detailLoop() method
// Initialize loop control variable.
// Write your counter controlled while loop here
// Multiply by 10
// Multiply by 100

Provide complete and step by step solution for the question and show calculations and use formulas.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Counter-controlled while loop
Reference No:- TGS01926168

Now Priced at $20 (50% Discount)

Recommended (96%)

Rated (4.8/5)