/* *Com S 207 *Hw 6 *Beer.java */ import java.util.Scanner; public class Beer { public static void main(String[] args) { int bottles, left; Scanner scan = new Scanner (System.in); String another = "y"; bottles = 100; left = 99; int i = -1; do{ System.out.println("Please enter how many times you would like to repeat the verse (1-100): "); i = scan.nextInt(); }while(i < 1 || i > 100); while(i > 0) { if(bottles>=1 && i>0) { System.out.println(bottles + " bottles of beer on the wall, "); System.out.println(bottles + " bottles of beer, "); System.out.println("If one of those bottles should happen to fall, "); System.out.println(left + " bottles of beer on the wall. \n"); bottles--; left--; i--; } if(bottles == 0) { System.out.println("No more bottles of beer on the wall, "); System.out.println("No more bottles of beer, "); System.out.println("Done!"); another = "n"; } } } }