Write a java program that models a restaurant ordering system.  You will need to have the following methods: public static int displayMenu() This method will display the menu items and price per item. Please keep the same 5 items as I have.  You need an option so that the customer can indicate that ordering is done. This method will read the choice from the customer and return that number. public static double getQuantityAndCost(int x) This method will prompt the user for the quantity for the menu choice and then multiply by the appropriate amount.  For example, if the user had selected Tacos, then x would be passed in as the value 2 and the return value for this method would be 2 * 4.00. public static double AddTipAmount(double sum) This method will prompt the user for a tip amount. The method receives sum which is the total on the bill after the user has selected Done ordering. For example, the method is called with a sum of 22.00 and the user indicate 10 percent for the tip, the method should return 22.00 + 2.20, or 24.20. The menu will be displayed and get the customer’s item, quantity and cost for will be calculated until the user has selected the Done option.   After Done ordering (6) is selected, ask the user for a tip amount. Then finally display the total bill.  You will need a main that uses a sentinel controlled while loop to display the menu, get quantity and cost. After the user has selected Done ordering the main will add the tip amount, and finally display the total bill. Sample run below Welcome to Café Grub.  Please make your choices and select 6 when you are finished. Menu 1 : Pizza $2.50 2 : Tacos $4.00 3 : Lasagna $5.00 4 : Sushi $3.00 5 : Fish $7.00 6 : Done ordering   Please enter your choice:   2 Please enter quantity:  2 Menu 1 : Pizza $2.50 2 : Tacos $4.00 3 : Lasagna $5.00 4 : Sushi $3.00 5 : Fish $7.00 6 : Done ordering Please enter your choice: 5 Please enter quantity: 2 Menu 1 : Pizza $2.50 2 : Tacos $4.00 3 : Lasagna $5.00 4 : Sushi $3.00 5 : Fish $7.00 6 : Done ordering Please enter your choice: 6 Enter tip amount as % i.e. 15:  10 The total bill is $24.20

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write a java program that models a restaurant ordering system.  You will need to have the following methods:

public static int displayMenu()

This method will display the menu items and price per item. Please keep the same 5 items as I have.  You need an option so that the customer can indicate that ordering is done. This method will read the choice from the customer and return that number.

public static double getQuantityAndCost(int x)

This method will prompt the user for the quantity for the menu choice and then multiply by the appropriate amount.  For example, if the user had selected Tacos, then x would be passed in as the value 2 and the return value for this method would be 2 * 4.00.

public static double AddTipAmount(double sum)

This method will prompt the user for a tip amount. The method receives sum which is the total on the bill after the user has selected Done ordering. For example, the method is called with a sum of 22.00 and the user indicate 10 percent for the tip, the method should return 22.00 + 2.20, or 24.20.

The menu will be displayed and get the customer’s item, quantity and cost for will be calculated until the user has selected the Done option.  

After Done ordering (6) is selected, ask the user for a tip amount. Then finally display the total bill.  You will need a main that uses a sentinel controlled while loop to display the menu, get quantity and cost. After the user has selected Done ordering the main will add the tip amount, and finally display the total bill.

Sample run below

Welcome to Café Grub.  Please make your choices and select 6 when you are finished.

Menu

1 : Pizza $2.50

2 : Tacos $4.00

3 : Lasagna $5.00

4 : Sushi $3.00

5 : Fish $7.00

6 : Done ordering

 

Please enter your choice:   2

Please enter quantity:  2

Menu

1 : Pizza $2.50

2 : Tacos $4.00

3 : Lasagna $5.00

4 : Sushi $3.00

5 : Fish $7.00

6 : Done ordering

Please enter your choice: 5

Please enter quantity: 2

Menu

1 : Pizza $2.50

2 : Tacos $4.00

3 : Lasagna $5.00

4 : Sushi $3.00

5 : Fish $7.00

6 : Done ordering

Please enter your choice: 6

Enter tip amount as % i.e. 15:  10

The total bill is $24.20

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY