Question: You are tasked with creating a Java program for a restaurant receipt system. The program should allow the user to enter the number of items

You are tasked with creating a Java program for a restaurant receipt system. The program should allow the user to enter the number of items ordered by a table. After that, the user should input the name and price of each item. Finally, the program should calculate and print a receipt showing the details of the items ordered, the cost of food, the tax (9% of the cost), the tip (20% of the cost), and the total amount to be paid.Instructions:Input: Prompt the user to enter the number of items ordered by the table.Item Details: Using a loop, prompt the user to input the name and price of each item ordered. Store this information in 2 arrays (String and double)Calculate Total Cost: (create three methods to complete these tasks tasks)Sum up the prices of all the items to get the total cost of the food.Calculate the tax, which is 9% of the total cost.Calculate the tip, which is 20% of the total cost.Print Receipt: (create a method to complete this task)Print a header indicating that it's a receipt.Print the details of each item ordered (name and price).Print the total cost of the food.Print the tax amount.Print the tip amount.Print the total amount to be paid (total cost + tax + tip).Example Output:Restaurant Receipt-------------------Item Details:1. Burger - $10.992. Salad - $7.493. Soda - $1.99Cost of Food: $20.47Tax (9%): $1.84Tip (20%): $4.09-------------------Total Amount: $26.40

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Programming Questions!