import java.util.Scanner;
public class doctoleroquiz2
{
public static void main (String [] args)
{
Scanner cashier = new Scanner(System.in);
double num1;
double num2;
double num3;
double num4;
double num5;
int quantity;
int churva;
int box;
System.out.println(" 1. Pancake 3.75 \n 2. Ring Bread 11.25 \n 3. Pita Bread 34.50\n 4. Sweet Bun 9.50\n 5. Waffle 12.75");
System.out.println();
System.out.print("Choose a bread: ");
churva = cashier.nextInt();
System.out.print("Enter Quantity: ");
quantity = cashier.nextInt();
switch (churva) {
case 1:
num1=3.75;
System.out.println("Try our special syrup at 9.00 only");
System.out.print("How many box of syrup will you order? ");
box = cashier.nextInt();
System.out.print("Please pay " +((num1*quantity)+(9*box)));
break;
case 2:
num2=11.25;
System.out.println("Try our special cheese at 35.00 only");
System.out.print("How many box of cheese will you order? ");
box = cashier.nextInt();
System.out.print("Please pay " +((num2*quantity)+(35*box)));
break;
case 3:
num3=34.50;
System.out.println("Try our special ground beef at 20.00 only");
System.out.print("How many kilos of ground beef will you order? ");
box = cashier.nextInt();
System.out.print("Please pay " +((num3*quantity)+(20*box)));
break;
case 4:
num4=9.50;
System.out.println("Try our special takoyaki at 15.00 only");
System.out.print("How many peices of takoyaki will you order? ");
box = cashier.nextInt();
System.out.print("Please pay " +((num4*quantity)+(15*box)));
break;
case 5:
num5=12.75;
System.out.println("Try our special syrup at 9.00 only");
System.out.print("How many box of syrup will you order? ");
box = cashier.nextInt();
System.out.print("Please pay " +((num5*quantity)+(9*box)));
break;
}
}
}
No comments:
Post a Comment