Question: In this question, you will write a JAVA program to help the customer order food online and calculate the total price. Your program should follow
In this question, you will write a JAVA program to help the customer order food online and calculate the total price.
Your program should follow the following rules:
-
Prompt the user to enter the choice based on the menu and validates the information
-
The choice should be an integer number displayed on menu from 1 to 6.
-
A price to calculate the total expense of the user.
-
Please find the menu and price in the following table. You must use switch statement to
-
create the menu options.
-
Your program should be able to ask users new choice if the user enters Yes for more food.
-
If the total price is less than $50, the customer needs to pay $5 for delivery.
-
Your program should ask the amount of tips that the customer would like to pay.
-
Display welcome/closing messages.


+++++++++++++++++++++++++++++++++++++++++++++++++++++ Welcome to Online Order Program! +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1. Hamburger 2. Pizza 3. Noodle 4. Salad 5. Sandwich 6. Exit +++++++++ +++++ Please enter your choice (1-6): 0 That is a wrong input. Please try again! Please enter your choice (1-6): 3 Your choice is: Noodle. Would you like to have some meat on your Noodle? Yes Beef or Pork? beef Would you like to have more food? Yes Please enter your choice (1-6): 5 Your choice is: Sandwich. Would you like to have some meat on your Sandwich? Yes Beef or Pork? beef Would you like to have more food? no No need to pay the delivery fee. Would you like to pay some tips? Please enter the amount: 5.5 The total price is $56.5. Thank you for using Online Order Program! Menu 1. Hamburger 2. Pizza 3. Noodle 4. Salad 5. Sandwich 6. Exit Price without Meat $7.5 $7.5 $7.5 $7.5 $7.5 Price with beef $25.5 $25.5 $25.5 $25.5 $25.5 Price with pork $17.5 $17.5 $17.5 $17.5 $17.5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
