#include <iostream.h> //input output stream libraray
#include <string.h> //string libraray
#include <iomanip.h> //input output manipulation library
using namespace std;
float CalculateTax(float);
int CalculateTotalBill(float,float);
void Prize(int prize);
float dev,TotalTax,Cal;
double GrandTotal=0;
int RecordCount=1;
int main()
{
cout<<right<< setw(50)<<"Virtual Restuarant"<<endl;
int Price,;
char choice;
LoopHere:
cout<<"Enter the price of the meal: "<<endl;
cin>>Price;
Prize(CalculateTotalBill(Price,CalculateTax(Price)));
cout<<"\n \nDo u want to process any other custome?"<<endl;
cout<<"enter 'Y' to continue or 'N'to cancel"<<endl;
cin>>choice;
if((choice=='y') || (choice=='Y'))
{
++RecordCount;
goto LoopHere;
}
else if((choice=='n') || (choice=='N'))
{
cout<<"Total Entries were found: "<<RecordCount<<endl;
cout<<"grand total is: "<<GrandTotal<<endl;
system("pause");
}
else
{
cout<<"insaan da bacha ban k input dou"<<endl;
}
return 0;
}
float CalculateTax(float P)
{
if((P>1000) && (P<=2000))
{
dev= 1.0;
TotalTax= (dev/ 100)*P;
return TotalTax;
}
else if(P>2000)
{
dev= 2.0;
TotalTax= (dev/ 100)*P;
return TotalTax;
}
else
{
TotalTax=0.0;
return TotalTax;
}
}
int CalculateTotalBill(float Amount,float TaxPayable)
{
cout<<"Price of the meal: "<<"\t"<<Amount<<endl;
cout<<"Payable tax is: "<<"\t"<<TaxPayable<<endl;
cout<<"---------------------------------"<<endl;
cout<<"Total amount:"<<"\t\t"<<Amount+TaxPayable<<endl;
GrandTotal+=Amount+TaxPayable;
return Amount+TaxPayable;
}
void Prize(int prize)
{
if(prize<1000)
{
cout<<"this GAAHAK should be served with candies"<<endl;
}
else if ((prize>=1000) && (prize<2000))
{
cout<<"this GAAHAK should be served with Sweet Bread"<<endl;
}
else if ((prize>=2000) && (prize<3000))
{
cout<<"this GAAHAK should be served with Pudding"<<endl;
}
else if ((prize>=3000) && (prize<4000))
{
cout<<"this GAAHAK should be served with Cake"<<endl;
}
else
{
cout<<"this GAAHAK should be served with Trifile"<<endl;
}
}
On Tue, Nov 1, 2011 at 11:19 PM, mc110401975 Saira Yasmeen <mc110401975@vu.edu.pk> wrote:
kya mj cs201 ki assignment mien hlp mil sakti hai plz bec aj last date hai i hav no idea about this program plz help me
--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en
--
We say, "Be one as Pakistani Nation and grow up for Pakistan's Future". Wish you all the best. Join www.vuaskari.com,
To post to this group, send email to vuaskari_com@googlegroups.com
Visit these groups:
This (Main) Group:http://groups.google.com/group/vuaskari_com?hl=en?hl=en
MIT/MCS Group: http://groups.google.com/group/vu_askarimit?hl=en?hl=en
HRM Group: http://groups.google.com/group/askari_hrm?hl=en?hl=en
Banking Group: http://groups.google.com/group/askari_banking?hl=en?hl=en
Management: https://groups.google.com/group/vuaskari_mgt?hl=en
Marketing: https://groups.google.com/group/vuaskari_mkt?hl=en
MIS Group: http://groups.google.com/group/askari_mis?hl=en
No comments:
Post a Comment
PLEASE COMMENT ABOUT YOUR VISIT AND MY SITE
Note: Only a member of this blog may post a comment.