Question
This program is a java program where the main point is to build a little on-line food shop. Try to use methods to complete functions.
This program is a java program where the main point is to build a little on-line food shop. Try to use methods to complete functions.
Program requirements: A food market store invites you to help them build an on-line food order program. Customers can use this program to order food on-line.
The program should include at least 4 functionalities: 1) Add food in order; 2)Remove food from order; 3) Review order; 4) Check out the order. You can use a menu as a UI (user interface).
Assume there are 4 types of food: Hamburger ($8), Lemonade ($3), Chicken Wing ($1), and Pizza ($6). Customer can order any kinds of food, and any amount of them.
Scenario 1: Costumer A ordered 3 Hamburger and 2 Lemonade, and then removed 1 Hamburger and ordered 5 Chicken wings. Check them out finally.
Scenario 2: Costumer B ordered 10 chicken wings and 1 pizza, and then he reviewed his order,
and then add 1 more pizza. Check them out finally.
i) In the add food in order module, your program may need a menu too to show all sorts of food and their price. The input should be food ID and amount. Your program should record the information to calculate the total fee.
ii) In the review order module, all kinds of food information the customer ordered will be shown. The information includes unit price, amount, subtotal fee, and total fee.
iii) In the remove food from order module, customer can remove food from order. The input should be the food ID and amount. Your program should record the changed information.
iv) In the checking out module, the program will print out the bill (review information and tax fee and checkout fee). Checkout fee= total + tax. Taxfee = total * 7.77%. Taxrate: 7.77%. In addition, you can add other modules, such as customer login module, food delivery module, etc.
Output looks like the following:
This output is just an example. You may make it better.
Hint: You may need to declare several global variables to contain customer's order information, like the quantity of any food, the prices, and so on, so that your methods can use them directly. Or the methods pass the data to each other by parameters and returning data.
Hint: You may need the following methods to be created: functionMenu(), foodMenu(), add FoodToOrder(), removeFoodFromOrder(), reviewOrder(), and checkout().
Hint:In the main method, you may need a
sentinel control led loop to control the whole process.
Hint: Think about the situations that the customers mayinput a wrong characterumber.
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