Define a struct menuItemType with two components: menuItem of type string and menuPrice of type
double. Write a program to help a local restaurant automate its breakfast billing system. The program
should do the following:
a. Show the customer the different breakfast items offered by the restaurant.
b. Allow the customer to select more than one item from the menu.
c. Calculate and print the bill.
Assume that the restaurant offers the following breakfast items (the price of each item is shown to the
right of the item):
Plain Egg - $1.45
Bacon and Egg - $2.45
Muffin - $0.99
French Toast - $1.99
Fruit Basket - $2.49
Cereal - $0.69
Coffee - $0.50
Tea - $0.75
Use an array menuList of type menuItemType, as defined
Your program must contain at least the following
functions:
- Function getData: This function loads the data into the array menuList.
- Function showMenu: This function shows the different items offered by the restaurant and tells
the user how to select the items.
- Function printCheck: This function calculates and prints the check. (Note that the billing amount
should include a 5% tax.)
A sample output is:
Welcome to Johnny's Restaurant
Bacon and Egg - $2.45
Muffin - $0.99
Coffee - $0.50
Tax - $0.20
Amount Due - $4.14
Format your output with two decimal places. The name of each item in the output must be left justified.
You may assume that the user selects only one item of a particular type.
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
- 3) Suppose an airline company has hired you to write a program for choosing the passengers who should leave an overbooked flight. That means the airline has booked too many passengers hoping some of them would not show up on time, but passengers are on board and the aircraft doesn't have enough seats available for all these passengers. Your program chooses the passenger who must leave the flight. Passengers will be ranked based on the fare they have paid for booking (a double number called fare), and their number of loyalty points (an integer number called points). Fare and points are equally important, that means, in order to decide the position of each passenger in the list, fare and points each have 50% importance. A Person with minimum priority (combination of fare and points) will leave the flight. You need to define a class called Passenger with these member variables: passenger's name • fare points. Passenger class must have 3 accessors, 3 mutators, a constructor with three…arrow_forwardA company wants to know the percentages of total sales and total expenses attributableto each salesperson. Each person has the following data: name – last name and firstname, sales, and expenses. Write a program that produces a report with a header linecontaining the total sales and total expenses. Following this heading should be a tablewith each salesperson’s name, percentage of total sales, and percentage of totalexpenses sorted by the salesperson’s name. Use a total of 25 records for this project.arrow_forwardIn java Develop a function that takes two integers and returns the sum of the values from the first to the second (the two inputs may be in any order). Call the function at least twice with different arguments Develop a void function PrintLineOfChar that accepts a single character and an integer. The function prints a single line of the character repeated the integer number of times. Call the function at least twice with different arguments.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education