Problem statement: *** virtual restuarant*** you are required to write a program
ID: 3631882 • Letter: P
Question
Problem statement: *** virtual restuarant*** 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 the mea price as input from the 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.
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.
program will be written in devC++
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.
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<<"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;
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.