import java.util.Scanner; public class MP2{ public static void main (String[] args){ //initialization and declaration Scanner input = new Scanner (System.in); String message; int Option1; int Option2;...


import java.util.Scanner;
public class MP2{


public static void main (String[] args){


//initialization and declaration


Scanner input = new Scanner (System.in);
String message;
int Option1;
int Option2;
int Quantity;
int TotalBill;
int Cash;
int Change;
final int SPECIALS = 1;
final int BREAKFAST = 2;
final int LUNCH = 3;
final int SANDWICHES = 4;
final int DRINKS = 5;
final int DESSERTS = 6;


//For the Special, Breakfast, Lunch Options
final int Meals1 = 11;
final int Meals2 = 12;
final int Meals3 = 13;
final int Meals4 = 14;


//First menu and First Option
System.out.println("\t Welcome to My Kitchen ");
System.out.println("\t\t SPECIALS");
System.out.println("\t\t [2] BREAKFAST MEALS");
System.out.println("\t\t [3] LUNCH MEALS");
System.out.println("\t\t [4] SANDWICHES");
System.out.println("\t\t [5] DRINKS");
System.out.println("\t\t [6] DESSERTS");
System.out.println("\t\t [0] EXIT");


System.out.print("Choose an option ");
Option1 = input.nextInt();


//first switch case statements


switch(Option1){


case (SPECIALS):
message = "**********[SPECIALS]**********\n\t [11] Baked Macaroni \n\t [12] Baked Spaghetti \n\t [13] Beef with Vegetables \n\t [14] Mongolian BBQ \n\n\t [0] Exit";
break;
case (BREAKFAST):
message = "**********[BREAKFAST MEALS]**********\n\t [11] Egg & Bacon with Rice \n\t [12] Egg & Longganisa with Rice \n\t [13] Omelette \n\t [14] Pancake BBQ \n\n\t [0] Exit";
break;
case (LUNCH):
message = "**********[LUNCH MEALS]**********\n\t [11] Beef Ribs \n\t [12] Burger Steak \n\t [13] Fried Chicken Fillet \n\t [14] Pork BBQ \n\n\t [0] Exit";
break;
case (SANDWICHES):
message = "**********[SANDWICHES]**********\n\t [1] Clubhouse Sandwich \n\t [2] Cheeseburger \n\t [3] Grilled Cheese Sandwich \n\t [4] Ham & Cheese Sandwich \n\n\t [0] Exit";
break;
case (DRINKS):
message = "**********[DRINKS]**********\n\t [1] Coke \n\t [2] Sprite \n\t [3] RootBeer \n\n\t [0] Exit";
break;
case (DESSERTS):
message = "**********[DESSERTS]**********\n\t [1] Fruit Salad \n\t [2] IceCream \n\t [3] Cheesecake \n\n\t [0] Exit";
break;
default:
message = "Thank You and come again";
break;
}
System.out.println(message);


//2nd Options and 2nd switch case statements


System.out.print("Choose an option: ");
Option2 = input.nextInt();


switch (Option2){


case (SPECIALS):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (BREAKFAST):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (LUNCH):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (SANDWICHES):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (DRINKS):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (DESSERTS):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (Meals1):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (Meals2):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (Meals3):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
case (Meals4):
message = "**********[Choices]**********\n\t [11] Small \n\t [12] Medium \n\t [13] Large \n\t [14] Extra Large \n\n\t [0] Exit";
break;
default:
message = "Thank you and come again";
break;


}


System.out.print(message);
System.out.print("Choose an option: ");
Option1= input.nextInt();


//Computing for the prices and giving change
System.out.print("Quantity: ");
Quantity = input.nextInt();
TotalBill = Quantity * 50;
System.out.println("Total Bill is "+TotalBill);
System.out.print("Cash: ");
Cash = input.nextInt();
Change = Cash - TotalBill;


//if statement
if (Cash <>
System.out.print ("Not enough payment");
else
System.out.println ("Change is: "+Change);
//Outro
System.out.println("Thank You and come again at My Kitchen!");


}
}


Programming Problem:<br>Using Loops and Methods that were previously discussed in modules 8&9, modify the<br>program code you have submitted in MP2 to do the following:<br>1. Place all the Menus in separate Methods.<br>2. Place computations in separate Methods and call the methods once needed.<br>3. Enable looping of the program to:<br>a. Return to specific Menu (e.g. Meal Menu, Drinks Menu, Pasta Menu, etc.)<br>b. Return to the Main Menu from any point within the program<br>c. Let the program repeat until the customer doesn't want to order anymore.<br>Please note: Menu structures and variables need to be labeled with intuitive identifier<br>names intended for their purpose.<br>

Extracted text: Programming Problem: Using Loops and Methods that were previously discussed in modules 8&9, modify the program code you have submitted in MP2 to do the following: 1. Place all the Menus in separate Methods. 2. Place computations in separate Methods and call the methods once needed. 3. Enable looping of the program to: a. Return to specific Menu (e.g. Meal Menu, Drinks Menu, Pasta Menu, etc.) b. Return to the Main Menu from any point within the program c. Let the program repeat until the customer doesn't want to order anymore. Please note: Menu structures and variables need to be labeled with intuitive identifier names intended for their purpose.
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here