Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is a C++ program This is a c++program! Write three independent functions to handle the problem of cakulating the bill at a coffee shop
This is a C++ program
This is a c++program! Write three independent functions to handle the problem of cakulating the bill at a coffee shop The first prompts for input values and back to the caller This fianction ensures that the quantities input are reasonable The second calculates the prices of each item purchased, subotal the grand total of the ball. The third prints the bill itself The bill is to written output file. Since output function is the only place in the program that deals with the file, it can open and close the file The tasks done by the functions be en up along these lines Write a mara function that declares local variables for the values yeuneed to handle and passes them to the functions as needed You MAY NOT use ANY global wariables for tai prastam You are OK The mput function prompts the user for the tumber of each item purchased, and verifies the inputs Force all input values to be greater than or equal to zero, with validation of the values done independently. You may do item prompting in a sub function. The calculation function needs takes the input values, and calculates the subeotal tax at l0 a and the grand total. The coffee shop sells coffee S2.25 per cup, si 50 various for each. Format the output in a reasonable way that lines up the purchases You may print the S to the left of the field if you wish The sales tax must be rounded to the nearest cent You could write a founding sub The output will look something like this My Coffee Shop Quantity 3 s 75 you may shift s signs left coffee Tea 50 Pastry Sub Total s 1.38 you may print leading before any dea inal point $15.13 ffer shap. Te th several sales, ukusg 0 oe more Pick a reasonable name for your co you program nems of each type As usual submit your curce code and fod each nun ofthe program submit what and the contents ofthe output file. ball) appears on the consoleStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started