Question: Please review my code and help me run it successfully: package coffee; import java.util.Scanner; / * * * Program will help user decide what type

Please review my code and help me run it successfully:
package coffee;
import java.util.Scanner;
/**
*Program will help user decide what type of drink to order.
* @author carmendeloach
*/
public class Coffee {
public static void main(String[] args){
Scanner in = new Scanner(System.in);
int choice = in.nextInt();
String size = size("");
boolean cream;
cream = in.nextBoolean();
System.out.print ("Please take a look at the drink choices");
//Display menu
System.out.println("Carmen's Cafe Menu");
System.out.println("=======================");
System.out.println("1. Americano");
System.out.println("2. Espresso");
System.out.println("3. Latte");
System.out.println("4. Iced Coffee");
System.out.println("======================");
System.out.print("Enter menu number option");
//Get choice from user
//Check choice
System.out.println("Please enter your choice");{
}
if (choice ==1){
System.out.println("Americano coffee, great choice!");
System.out.println("Would you like cream?");
//I can't figure out where to put these arguments and the code actually runs
//I tried putting it at line 22 but that didn't work.
cream = in.nextBoolean();
System.out.println("The boolean value entered ="+ cream);
}
else if (choice ==2){
System.out.println("Espresso! Would you like a 1.single or 2.double?");
int shot = in.nextInt();
}
else if (choice ==3){
System.out.println("Latte! The only milk we have is Almond though.");
}
else if (choice ==4){
System.out.println("Iced Coffee");
}
else if (choice <4){
System.out.println("That is not a menu option, try again");
}
System.out.println("What size drink would you like?");
{
String size = scanner.nextLine();
}
System.out.println("Drink choice "+ choice +" size of drink" + size);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!