Write a program that computes and displays a customer’s bill for an All-You-Can-Eat Buffet Restaurant. The charge for an adult meal is $6.00 and a child’s (ages 5 to 10) meal is $3.00. The tax rate is 6.5%. The desserts offered at the restaurant are slices of pie at $1.00 per slice. Gratuity is automatically calculated at 15%. Use main( ) as the driver function. Allow the user to process as many customer bills as desired. Use named constants and perform input validation when appropriate.
a. Write one function to prompt the user for the following customer information:
• Date of the bill.
• Customer’s Name.
• Number of Adult Meals.
• Number of Child Meals.
• Number of Desserts.
b. Write one function to calculate all charges necessary for the customer’s bill as displayed below.
c. Write one function to display the customer’s bill using the following information: the date, the Customer’s Name, Number of Adult Meals and charge, Number of Child Meals and charge, Dessert Charge, Taxes, Subtotal, Gratuity (Tip) Charge, and Total Charges.
Sample I/O:
Please enter the following Customer's Information.
Date: 4-6-05
Customer's Name: The Bill Jones Family
Number of Adult Meals: 2
Number of Child Meals: 3
Number of Desserts: 5
The All-You-Can-Eat Buffet Restaurant
Date: 4-6-05
Customer's Name: The Bill Jones Family
Adult Meal Charge: 2 @ 6.00 each $ 12.00
Child Meal Charge: 3 @ 3.00 each $ 9.00
Dessert Charge: 5 @ 1.00 each $ 5.00
Taxes $ 1.69
Subtotal: $ 27.69
Gratuity Charge: ( 15.00 %) $ 4.15
TOTAL DUE: $ 31.84
Thank you for eating at the All-You-Can-Eat Buffet Restaurant. Please come again.
Would you like to process another customer's bill? (Y or N) N
C++ code
#include <iostream>
#include <string>
using namespace std;
void input(string &date ,string &name,int &adult,int &child, int &desserts ){ //input funtion use value by refrence
cout<<"Please enter the following Customer's Information."<<endl;
cout<<"Date: ";
getline(cin,date);
cout<<"Customer's Name: ";
getline(cin,name);
cout<<" Number of Adult Meals: ";
cin>>adult;
cout<<"Number of Child Meals: ";
cin>>child;
cout<<"Number of Desserts: ";
cin>>desserts;
}
void calculate(int adult,int child, int desserts,double &tax,double &sub,double &gratuity,double &total){
const int gratuityPer=15;
const int adultprice=6;
const int childpri=3;
const double taxPer=6.5;
sub=(adult*adultprice)+(child*childpri)+(desserts); //sub total
tax=(sub*taxPer)/100.0;//computing tax
sub+=tax; //sub total with tax
gratuity=(sub*gratuityPer)/100.0; //tip
total=sub+gratuity; //grand total
}
void output(string date,string name,int adult,int child,int desserts,double tax,double sub,double gratuity,double total){ //printing output
cout<<"The All-You-Can-Eat Buffet Restaurant\n";
cout<<"Date: "<<date<<endl;
cout<<"Customer's Name: "<<name<<endl;
cout<<"Adult Meal Charge: "<<adult<<" @ 6.00 each $ "<<(adult*6)<<endl;
cout<<"Child Meal Charge: "<<child<<" @ 3.00 each $ "<<(child*3)<<endl;
cout<<"Dessert Charge: "<<desserts<<" @ 1.00 each $ "<<desserts<<endl;
cout<<"Taxes $ "<<tax<<endl;
cout<<"Subtotal: $ "<<sub<<endl;
cout<<"Gratuity Charge: ( 15.00 %) $ "<<gratuity<<endl;
cout<<"TOTAL DUE: $ "<<total<<endl;
cout<<"Thank you for eating at the All-You-Can-Eat Buffet Restaurant. Please come again."<<endl;
}
int main() {
string date ,name;
int adult,child,desserts;
double tax,sub, gratuity,total,childC,adultC,dessertsC;
char ch;
do{
input(date,name,adult,child,desserts);
calculate( adult, child, desserts,tax, sub,gratuity,total);
output( date, name, adult, child, desserts, tax, sub, gratuity, total);
cout<<"Would you like to process another customer's bill? (Y or N) ";
cin>>ch;
}while(ch=='Y');
return 0;
}
OUTPUT:

IF YOU HAVE ANY QUERY PLEASE COMMENT DOWN BELOW
PLEASE GIVE A THUMBS UP
Write a program that computes and displays a customer’s bill for an All-You-Can-Eat Buffet Restaurant. The...
Write a program for a Buffet to display the bill Sor the cashicr The buffet serves a chef's meu with two options 31 50 The total adu bill is roduced by $5.00 if there are 9 aor more ad $15.00 It is free after the third child maximum of 3 childrm) The program requests the name and zip code ofthe buf1ส and converts the tru The pr- then aceepts the number of adults and children, performs the necessary calculations compues...
A local restaurant offers an all-you-can-eat buffet. The graph shows the marginal revenue and demand curves for two segments of the market: average consumers and senior citizens. Market for All-You-Can-Eat Buffet Average Consumers Costs and Revenues (dollars) 0 5 10 15 20 25 30 35 40 45 50 Quantity (meals) Instructions: Enter your answers as a whole number. a. Suppose the firm has the ability to be a price maker. What is the profit-maximizing level of output and price? The...
The restaurant at the Hotel Galaxy offers two choices for breakfast: an all-you-can-eat buffet and an a la carte option, where diners can order from the menu. The buffet option has a budgeted meal price of $52. The a la carte option has a budgeted average price of $41 for a meal. The restaurant manager expects that 40 percent of its diners will order the buffet option. The buffet option has a budgeted variable cost of $32 and the a...
The Organic Buffet offers an all-you-can-eat buffet meal for $ 34 per person. The restaurant employs ten salaried employees. Rent for the building, employee salaries, and other fixed costs for the restaurant are $ 118 comma 800 per month when the restaurant serves meals up to 13 comma 900 guests in that month. If the restaurant were to serve more than 13 comma 900 guests in any given month, it would need to hire two additional servers and two additional...
12. The Johnson Buffet offers an all-you-can-eat buffet meal for $28 per person. The restaurant employs ten salaried employees. Rent for the building employee salaries, and other fixed costs for the restaurant are $67,500 per month when the restaurant serves meals up to 14,200 guests in that month. If the restaurant were to serve more than 14,200 guests in any given month, it would need to hire two additional servers and two additional kitchen staff for an additional fixed cost...
The Wholesome Buffet offers an all-you-can-eat buffet meal for $33 per person. The restaurant employs ten salaried employees. Rent for the building, employee salaries, and other fixed costs for the restaurant are $63,500 per month when the restaurant serves meals up to 13,900 guests in that month. If the restaurant were to serve more than 13,900 guests in any given month, it would need to hire two additional servers and two additional kitchen staff for an additional fixed cost of...
A restaurant offers an "all you can eat" lunch buffet for $12. Jim has eaten three servings and is trying to decide whether or not to go back for a fourth. The economic way of thinking suggests that Jim should go back for the fourth serving if and only if Oa. his marginal benefit of the additional serving is greater than zero. Ob. his marginal benefit of the additional serving is at least $3. Oc. his marginal benefit of the...
C++ please Let's pretend that we can still go out to eat at a restaurant. Suppose we have the job to make a program that accepts a dinner reservation. The information collected will be the name of the customer, the date for the reservation, the time for the reservation (good choice for a hierarchical struct), the number in the party, email address (for updates) and phone number. Define a hierarchical structure for a dinner reservation that will contain the above...