Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

C++ Program Jason opened a coffee shop at the beach and sells coffee in three sizes: Small (9 oz.), Medium (12 oz.), and Large (15

C++ Program

Jason opened a coffee shop at the beach and sells coffee in three sizes: Small (9 oz.), Medium (12 oz.), and Large (15 oz.). A small cup of coffee is $1.75, a medium is $1.90, and a large is $2.00. Write a menu-driven program for Jason's Coffee Shop with the following menu options:

1. Sell Coffee

2. Total number of cups sold

3. Total ounces of coffee sold

4. Total amount of sales.

5. Help

6. Exit

Your program should have a separate function for each menu option. The Sell Coffee function should allow the user to sell any number of cups in any size to a customer. For example, a customer wants to purchase 3 small cups of coffee, 1 medium cup, and 2 large cups of coffee. So be sure to ask for the number of cups desired for each size. Make sure the user is entering integers for the number of cups. If not display the an error message and let them retry. This function should then calculate the total cost of the sale. Then it should display to the screen the number of small cups ordered and the total costs for the small cups, the number of medium cups ordered and the total costs for the medium cups, and the number of large cups ordered and the total costs of the large cups. Finally it should display the total amount of the sale for all cups. Be sure to format currency to look like currency.

The Total number of cups sold function, should calculate the number of small cups sold today, the number of medium cups, and the number of large cups. It should then display this information to the screen.

The Total ounces sold function should simply calculate the total number of ounces of coffee sold today and display this amount to the screen.

The Total amount of Sales function should calculate the total amount of money earned from sales today and display this amount to the screen.

The Help function should be a list of instructions on how to use the program.

Finally, the Exit menu option should simply exit the program.

Chapte 6 rubric

Menu

A menu of options is displayed to the user and is redisplayed after the user's choice is executed. Each menu option, except the Exit, is a function. The menu itself should be displayed and redisplayed using a function. The only processing that should be done in main is the calling of functions and exiting the program. Have the menu function display the menu, ask the user for a choice, and return the choice to main to be processed.

Calculations

All calculations are correct.

Sell Coffee Function

The menu option to sell coffee should allow for any number of cups of coffee in any size to be purchased. It should calculate the amount due for each size and the total amount due for the entire sale. It should then display the number of cups of each size sold along with the costs for the number of cups sold for each size and finally the total amount of the sale. Remember that you have to keep up the total number of each cup size sold, the total number of ounces of coffee sold and the total amount of sales throughout your program. DO NOT USE GLOBAL VARIABLES (Hint: You will need to pass some variables by reference). Be sure to format your output so that it looks like currency, decimals line up, it is neat and easy to read.

Total number of cups sold

This menu option is to show the total numbers of cups sold in each size.You will need to pass this information into this function. Make sure to format the output nicely.

Total ounces of coffee sold

This menu option will need to display the total amount of coffee sold in ounces. This information will need to be passed into this function. Remember to format the output nicely.

Total amount of sales.

This function will display the total amount of all sales. Output should be formatted to look like currency.

Constants

Constants should be used for coffee cup sizes and for the cost of each cup, and any others that you feel are necessary.

Help Menu

The Help menu option should be a function the display a list of instructions on how to use the program.

Exit

Exit needs to be a menu option. This option does not need a separate function. It could simply set a flag variable to true to end the program or print a message to the screen.

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_2

Step: 3

blur-text-image_3

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

How Do I Use A Database Research Tools You Can Use

Authors: Laura La Bella

1st Edition

1622753763, 978-1622753765

More Books

Students explore these related Databases questions