Begin with your corrected code from Program 5B: Restaurant Menu. (Be sure to see my solution and ensure that your code i

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Begin with your corrected code from Program 5B: Restaurant Menu. (Be sure to see my solution and ensure that your code i

Post by answerhappygod »

Begin with your corrected code from Program 5B: Restaurant Menu. (Be sure to see my solution and ensure that your code is accurate before you continue with this assignment.)
Extend your restaurant menu program to include:
You do NOT need to display an itemized list at the end. Once you learn more C++ skills you will add that feature. For now, simply display the grand total for all items ordered to the user at the end.
Your job is to redesign your code to use functions.
At a minimum, you must:
For example, if your Menu consists of:
1. Blueberry Pie
2. Apple Pie
3. Peach Pie
4. Pumpkin Pie
5. Quit
Then create a function called blueberryPie to process the order, adding the cost of blueberry pie to the total and asking the user about 3 options to add on while totaling the price. NOTE: This is mostly a copy and paste of your existing code.
You will need to move constants from main into the function to ensure that the scope (visibility) is accurate OR pass them as parameters. Your choice.
You decide if you use void or value returning functions and if you use value or reference parameters in your functions or none at all.
Each student's solution will be unique. And there are multiple design approaches that are correct.
No global variables are allowed. None. Nada. This is an exercise to reinforce the use of parameters and local variables and constants.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply