LoopPractice2 Class

 

import java.util.Scanner;

public class LoopsPractice2 {

public static void main(String[] args) {
Scanner input = new Scanner(System.in);
// For Loop Example
System.out.println("This is a for loop.");



// modify the printout so it starts at 1 and ends at 10
// modify the printout so it starts at 10, only prints multiples of 10 and ends at 100
// reverse the process so the loop counts down from 10 to 1

// while loop
System.out.println("This is a while loop.");
// it is possible that what is in the loop will NEVER be executed if the
// condition is not met


// skip this step and you create an infinite loop


// do while loop - guarantees that the code will run at least once
// great for providing menus that you want the user to choose from.
// Program continues to run until the exit condition is met, no need to restart the program.


System.out.println(" Have a nice day.");

}// end of main method

}// end of class