Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Activity description: Create a C + + program that will calculate the total dinner price in a restaurant. The program should have the following functions:

Activity description: Create a C++ program that will calculate the total dinner price in a restaurant. The program should have the following functions:
One function that will ask the user to enter the number of people for a table reservation. The number of people per table should be between 1 and 9, inclusive. If the user enters a number that is not between 1 and 9, the function will ask the user to enter another number. The function only returns a number between 1 and 9.
One function to prompt the menu, ask the user to pick a dish, and return the price of the dish. The menu is:
Dinner Entrees
Price
Blended burger
$13.99
Steak sandwich
$12.99
Salmon salad
$15.99
Chicken Parmesan
$11.99
Hint: you might use conditional statement to make the selection
One function to calculate the total price. This function should use a loop that will be executed based on the number of people at the table. On each run, or iteration of the loop, the function will call the function menu, and collect and add the price per dinner entree to the total price. At the end of the function, the total price should be returned as a float or double value.
One function to calculate and return the total tax. The tax is calculated as
Tax =0.0816* total price
One function to calculate and return the tip. The tip is calculated as
Tip =0.20* total price
One function to calculate and return the total price to pay. The total price to pay is calculated as
Total to pay = total price + tax + tip
One function to prompt the receipt as:
----------------------(STUDENTS FULL NAME)---------------------
Total number of people _________
Total price $________
Tax $ ________
Tip 20% $ ________
TOTAL TO PAY $ ________
Use \t to align the price display.

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

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books

Students also viewed these Databases questions