Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I just need the code Also am not sure why there's an error on line 35 2. Now we need to update the main class
I just need the code
Also am not sure why there's an error on line 35
2. Now we need to update the main class by adding menu options for the methods we added. Make the following changes to the main() method: Add a new menu option for checking on an order Add a new case to the switch statement for this new option Ask user to enter the order number for the order they want to check on Call the isorderDone method with user entered order number If the method returns 1, display "Your order has been completed" If the method return 0, display "Your order in being prepared If the method returns -99 display "Sorry, we can't find your order number in the system . Add a new menu option for canceling an order Add a new case to the switch statement for this new option Ask user to enter the order number for the order they want to cancel Call the cancelOrder method with user entered order number If the method returns true, display "Your order has been successfully cancelled Otherwise, display "Sorry, we can't find your order number in the system 32 33 34 public static void main(String [args) { Fast FoodKitchen kitchen new Fast FoodKitchen (). 36 Scanner sc new Scanner(System.in) 37 38 39 40 41 while (kitchen.getNumOrderspending () != 0) { vi see what the user wants to do System.out.println("Please select from the following menu System.out.println("\t 1. order food"); System.out.println("\t 2. Cancel last order"); System.out.println("\t 3. Show number of orders currently System.out.println("\t 4. Exit"); 42 43 44 45 46 int num = sc.nextInt (); switch (num) ! 48 49 50 51 case 1: System.out.println("How many hamburgers do you wa int ham = sc.nextInt (); System.out.println("How many cheeseburgers do you int: cheese = se.nextInt (): 52 53 CUJU - System.out.println("How many hamburgers do you wa int ham = sc.nextInt (); System.out.println("How many cheeseburgers do you int cheese sc.nextInt (); System.out.println("How many veggieburgers do you int veggie = sc.nextInt (); System.out.println("How many sodas do you want?") int sodas = sc.nextInt (); System.out.println("Is your order to go? (Y/N) "); char letter = sc.next().charAt(0) boolean TOGO = false; if (letter == 'Y' || letter == y) TOGO = true; ) int orderNum = kitchen. addorder (ham, cheese, vegg System.out.println("Thank you. Your order number System.out.println(); break; case 2: boolean ready kitchen.cancellastOrder(); if (ready) on nrintln(han mhat Otam case 2: boolean ready kitchen.cancelLastorder(); if (ready) { System.out.println("Thank you. The last order } else { System.out.println("Sorry. There are no order } System.out.println(); break; case 3: system.out.println("There are + kitchen.getNumo break; case 4: System.exit(0); break; default: System.out.println("Sorry, but you need to enter ) I end while Loop 1 > 2. Now we need to update the main class by adding menu options for the methods we added. Make the following changes to the main() method: Add a new menu option for checking on an order Add a new case to the switch statement for this new option Ask user to enter the order number for the order they want to check on Call the isorderDone method with user entered order number If the method returns 1, display "Your order has been completed" If the method return 0, display "Your order in being prepared If the method returns -99 display "Sorry, we can't find your order number in the system . Add a new menu option for canceling an order Add a new case to the switch statement for this new option Ask user to enter the order number for the order they want to cancel Call the cancelOrder method with user entered order number If the method returns true, display "Your order has been successfully cancelled Otherwise, display "Sorry, we can't find your order number in the system 32 33 34 public static void main(String [args) { Fast FoodKitchen kitchen new Fast FoodKitchen (). 36 Scanner sc new Scanner(System.in) 37 38 39 40 41 while (kitchen.getNumOrderspending () != 0) { vi see what the user wants to do System.out.println("Please select from the following menu System.out.println("\t 1. order food"); System.out.println("\t 2. Cancel last order"); System.out.println("\t 3. Show number of orders currently System.out.println("\t 4. Exit"); 42 43 44 45 46 int num = sc.nextInt (); switch (num) ! 48 49 50 51 case 1: System.out.println("How many hamburgers do you wa int ham = sc.nextInt (); System.out.println("How many cheeseburgers do you int: cheese = se.nextInt (): 52 53 CUJU - System.out.println("How many hamburgers do you wa int ham = sc.nextInt (); System.out.println("How many cheeseburgers do you int cheese sc.nextInt (); System.out.println("How many veggieburgers do you int veggie = sc.nextInt (); System.out.println("How many sodas do you want?") int sodas = sc.nextInt (); System.out.println("Is your order to go? (Y/N) "); char letter = sc.next().charAt(0) boolean TOGO = false; if (letter == 'Y' || letter == y) TOGO = true; ) int orderNum = kitchen. addorder (ham, cheese, vegg System.out.println("Thank you. Your order number System.out.println(); break; case 2: boolean ready kitchen.cancellastOrder(); if (ready) on nrintln(han mhat Otam case 2: boolean ready kitchen.cancelLastorder(); if (ready) { System.out.println("Thank you. The last order } else { System.out.println("Sorry. There are no order } System.out.println(); break; case 3: system.out.println("There are + kitchen.getNumo break; case 4: System.exit(0); break; default: System.out.println("Sorry, but you need to enter ) I end while Loop 1 > Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started