Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Write a program that stores the following data about an item on a menu in a structure: Description of the menu item Price of

C++

Write a program that stores the following data about an item on a menu in a structure: Description of the menu item Price of the item

The program should keep an array of 5 menu items, initialized with the following data: Cheeseburger 2.65 Hamburger 2.25 French Fries 1.35 Coke 1.75 Beer 3.00

When the program runs it should display the menu items, along with the corresponding prices, in a numbered list. It should then ask the user to enter the numbers of the items ordered by a given customer, followed by a 0. The program should then calculate and display the bill, including the description and price of each item ordered, the 8% sales tax, and the total amount due.

Your program should include the following functions: showMenu takes the array of menu items as an argument. This function should display the menu items and their prices with a corresponding number starting at 1. getOrder takes one int array argument. This function should ask the user to choose as many menu items as they like, using the corresponding number. The user may select the same number more than once to indicate a purchase more than one of that item. The choices should be stored in the int array, including the 0 after the last choice. printCheck takes the array of menu items and the int array of orders as arguments. This function should display the items ordered with their prices, and calculate and display 8% tax and the total amount due.

Note: you may assume there will be no more than 50 items sold to each customer.

1 Sample output (data does not need to line up in columns, but should be easy to read): Burger Cafe Menu 1 Cheeseburger 2.65 2 Hamburger 2.25 3 French Fries 1.35 4 Coke 1.75 5 Beer 3.00

Make your selections by number. Enter a number more than once to place multiple orders. When you are done, type 0. 2 1 3 3 4 0

Order Receipt: Hamburger 2.25 Cheeseburger 2.65 French Fries 1.35 French Fries 1.35 Coke 1.75 Tax 0.75 Amount Due 10.10

Your program must pass Test Case 0 (below) or you will receive a score of 30 or less with no credit for the other grading categories (correctness/constraints/style): Input: 1 5 0 Do not use classes!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Structure Of The Relational Database Model

Authors: Jan Paredaens ,Paul De Bra ,Marc Gyssens ,Dirk Van Gucht

1st Edition

3642699588, 978-3642699580

More Books

Students also viewed these Databases questions