Counter-Controlled while loop
Not what you're looking for?
Need help trying to figure out counter controlled while loop. I need to 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, I need to multiply the value of the loop control variable by 10 and by 100, then I need to 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
Purchase this Solution
Solution Summary
Counter-controlled while loops are examined.
Solution Preview
(--Please note that my work should only be used as a guidance and not be ...
Purchase this Solution
Free BrainMass Quizzes
Javscript Basics
Quiz on basics of javascript programming language.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Basic Networking Questions
This quiz consists of some basic networking questions.
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Word 2010: Tables
Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.