import java.util.Scanner; class p2{ static int CONES_PER_GALLON = 24; public static void main(String[] args){ Scanner myScanner = new Scanner(System.in); int gallons = 0; int cones = 0; int multiplier = 1; String dayType; System.out.printf("How many cones will you sell? "); cones = myScanner.nextInt(); myScanner.nextLine(); System.out.println(); System.out.printf("What type of day? (normal, busy, holiday) "); dayType = myScanner.nextLine(); // compute the number of gallons needed. gallons = (int) Math.ceil(cones/(float)CONES_PER_GALLON); if (dayType.equalsIgnoreCase("normal")) { multiplier = 1; } else if (dayType.equalsIgnoreCase("busy")) { multiplier = 2; } else if (dayType.equalsIgnoreCase("holiday")) { multiplier = 4; } else { multiplier = 1; System.out.printf("%s is not a known day type, using normal\n", dayType); } gallons = gallons * multiplier; System.out.printf("You will need %d gallons of ice cream\n",gallons); } }