im practicing how to do the do while loop in java and i cannot figure out how to lmake it start with zero instead of one so that the output would be o is o doubled and then quadrupled instedead of it saying number 1 and so forth.
Can someone please tell me how to do that?
here is the code i have written so far.
// NewestDoubleQuadruple.java - This program prints the numbers 0 through 10 along // with their values doubled and quadrupled. // Input: None. // Output: Prints the numbers 0 through 10 along with their doubles and quadruples. public class NewestDoubleQuadruple { public static void main(String args[]) { String head1 = "Number: "; String head2 = "Doubled: "; String head3 = "Quadrupled: "; int numberCounter; // Number 0 through 10. int doubled; // Stores the double of a number. int quadrupled; // Stores the quadruple of a number. final int NUM_LOOPS = 10; // Constant used to control loop. // This is the work done in the housekeeping() method System.out.println("Doubles and Quadruples" + "\n"); // This is the work done in the detailLoop() method numberCounter = 0; // Write your do while loop here do { numberCounter++; doubled=numberCounter*2; quadrupled=numberCounter*4; System.out.println(head1 + numberCounter); System.out.println(head2 + doubled); System.out.println(head3 + quadrupled); } while(numberCounter<NUM_LOOPS); // This is the work done in the EndOfJob() method System.exit(0); } // End of main() method. } // End of NewestDoubleQuadruple class.