Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Problem Statement: Virtual Restaurant You are required to write a program for BI

ID: 3632101 • Letter: P

Question

Problem Statement: Virtual Restaurant

You are required to write a program for BILLING SYSTEM of a virtual restaurant. The basic idea is that by entering the meal price, your billing system will calculate the Sales Tax, Total amount and Complement offer upon that meal. The program will process the billing of undetermined number for customers. At the end, program will show sum of total amount of all the customers.

Detailed Description:
Billing System should work as under:

? You are required to take meal price as input from user.
? After getting this input, program will calculate the sales tax on it as given below:

Meal Price Sales Tax applicable
Less than or equal to 1000 = No sales Tax on it.
Greater than 1000 and less than or equal to 2000 = 1% of meal price.
Greater than 2000 = 2% of meal price.

? After calculating the sales tax, program will calculate and display the total amount of the meal according to given formula:
Total Amount = Meal_Price + Sales_Tax
? Now, program will prompt to serve the complement sweet dish to customer on the basis of total amount as given below:


Total Amount Sweet Dishes
Less than 1000 Candies
Greater than or equal to 1000 and less than 2000 = Sweet Bread
Greater than or equal to 2000 and less than 3000 = Pudding
Greater than or equal to 3000 and less than 4000 = Cake
Other amounts = Trifle

? After displaying the information of one customer, the program should ask the user if he/she again wants to process the bill of another customer. The user will be given two options. If user selects “Y or y”, the program will start the processing of another customer. If user selects “N or n”, the billing system exits.

? Before exiting from billing system, this program should display the total number of customers it processed, and sum of total amount of all the customers.

Explanation / Answer

please rate - thanks

#include <iostream>
using namespace std;
int main()
{double meal,tax,rate,total,totalAll=0;
int cust=0;
char yes;
do
{
cout<<"Enter price of meal: ";
cin>>meal;
if(meal<=1000)
     rate=0;
else if(meal<=2000)
     rate=.01;
else
     rate=.02;
tax=meal*rate;
total=meal+tax;
cout<<" Virtual Restaurant ";
cout<<"Price of meal "<<meal<<endl;
cout<<"Tax "<<tax<<endl;

cout<<"Your meal total is "<<total<<endl;
cout<<"You are entitled to a complementary ";
if(total<1000)
     cout<<"candies ";
else if(total<2000)
     cout<<"Sweet Bread ";
else if(total<3000)
     cout<<"Pudding ";
else if (total<4000)
     cout<<"Cake ";
else
     cout<<"Trifle ";
cust++;
totalAll+=total;
cout<<"would you like to process another customer(Y/N)? ";
cin>>yes;
}while(yes=='y'||yes=='Y');
cout<<" SUMMARY Customers processed "<<cust<<endl;
cout<<"Total spent "<<totalAll<<endl;
system("pause");
return 0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote