Java Class Question?
b.Write an application that prompts the user to make a choice for a Coffee cup size, S for Small, T for Tall, G for Grande and V for Venti ? the prices of the cup sizes will be stored in a parallel double array as $2.00, $2.50, $3.25, and $4.50 respectively. Allow the user to choose if they would like to add a flavor to the coffee and add an additional $1.00 to the price of the coffee, display the total price of the cup of coffee after the user enters a selection.
October 10, 2011 at 5:33 PM
public static void main(String args)
Scanner input=new Scanner(System.in);
System.out.println("Choose Coffee Cup Size:");
System.out.println("S for Small");
System.out.println("T for Tall");
System.out.println("G for Grande");
System.out.println("V for Venti");
System.out.print("Enter your choice: ");
System.out.print("Do you want to add flavor to coffee?Yes/No: ");
System.out.println("Total Bill is: $"+totalPrice);
Related Tutorials/Questions & Answers: