Question: What loop can I use and how can the customer select the food they want along with the quantity and display a subtotal of what

What loop can I use and how can the customer select the food they want along with the quantity and display a subtotal of what they have in their cart and also allow them to see the menu again?
import java.util.Scanner;
public class UberEats {
public static void main(String[] args){
Scanner scan = new Scanner(
System.in);
System.out.println("Welcome to Uber Eats!");
System, out print ln("-------");
System.out.print ln("Chose an option(1-5)");
System.out.println("1. Add a food");
System.out.println("2. View cart");
System, out.println("3. Clear cart");
System.out, print ln("4. Checkout");
System, out.println("5. Exit");
System, out print ln("--
System. out.println("Burger: 10.00") ;
(10.00");
System.out.println("Fries: 3.00");
System.out.printh("Chicken Sandwich: 15.00");
System.out.println("Turkey Sandwich: 10.00");
System.out.println("Cesar Salad: 10.00");
System, out, println("Waffles: 10.50");
System.out.println("Chicken Strips: 9.00");
System, out.print ln("Soda: 2.50");
System.out.println("Mac and Cheese: 5.50");
System.out.printhn("Juice: 3.00");
System.out.println("Coffee: 2.50");
System.out. println("Soup: 7.00");
System.out.println("Please type the food you want to add:");
System, out print ln("-----------------------------");
String food = scan.nextLine();
If (
}
}
}
 What loop can I use and how can the customer select

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To implement the program allowing customers to select food specify quantity and display a subtotal youll need to use a loop for repeated interaction and a data structure to store the cart contents Her... View full answer

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 Databases Questions!