Professional Documents
Culture Documents
cout<<"press the serial number given with the flavours to select the cake";
cin>>serialnumber;
cout<<"the flavour you selected is number ="<<serialnumber<<endl;
switch (serialnumber)
{
case 0:
case 1:
case 2:
case 3:
case 4:
price =2000;
cout<<"the price of the cake is Rs "<<price<<endl;
break;
default:
cout<<"the selection is invalid"<<endl;
}
cout<<"do you want to cancel your order to select again ?"<<endl;
cout<<"enter y for yes and n for continuing with the same selection:"<<endl;
cin>>answer;
}while((answer=='y')||(answer=='Y'));
cout<<"how many cakes u want to order ?"<<endl;
cin>>order;
total=price*order;
cout<<"your bill is of rupess ="<<total<<endl;
cout<<"please pay the bill of amount ="<<total<<endl;
cin>>useramount;
if (useramount>=total)
{
cout<<"*************************classic
cakeshop**************************"<<endl;
cout<<"\t""\t""\t""*******""BILL RECIPTE" "********""\t""\t""\t"<<endl;
cout<<order<<"cake number "<<serialnumber<<"\t"<<"="<<total<<endl;
cout<<"amount paid ="<<useramount<<endl;
cout<<"change given ="<<(useramount-total)<<endl;
cout<<"THANK YOU FOR VISITING "<<endl;
}
if (useramount<total)
{
cout<<"the amount you enterd is inappropriate"<<endl;
cout<<"enter more amount ="<<total-useramount<<"to get the order"<<endl;
}
system("pause");
return 0;
}
void welcome (string string1)
{
cout<<"\t"<<"\t"<<"*****************************************************"<<endl;
cout<<"\t"<<"\t"<<"*****************************************************"<<endl;
cout<<"\t"<<"\t"<<"\t"<<string1<<endl;
cout<<"\t"<<"\t"<<"******************************************************"<<endl;
cout<<"\t"<<"\t"<<"******************************************************"<<endl;
}
void rangebased(int x)
{
{int selection,price,order,useramount,total;
char ans,y,Y;
if (x>=500&&x<1000)
{
cout<<"you can buy a fruit cake "<<"for seletion press 0";
cin>>selection;
}
if (x>=1000&&x<1500)
{
cout<<"you can buy a fruit cake or a choclate cake or a cheese cake";
cout<<"press 0 for fruit cake and 1 for choclate cake and 2 for cheese cake selection";
cin>>selection;
}
if (x>=1500&&x<2000)
cout<<"you can buy a fruit cake ,choclate cake or a cheese cake or a mousee
cake ";
cout<<"press 0 for fruit cake and 1 for choclate cake and 2 for cheese cake and 3 for
mousee selection";
cin>>selection;
}
if (x>=2000&&x<2500)
{
cout<<"you can buy a fruit cake ,choclate cake or a cheese cake or a mousee
cake or a cofee cake";
cout<<"press 0 for fruit cake and 1 for choclate cake and 2 for cheese cake and 3 for
mousee and 4 for cofeee selection";
cin>>selection;
}
do{
switch (selection)
{
case 0:
cout<<"the cake u selected is fruite cake ";
price=500;
cout<<"the price of the cake is "<<price;
break;
case 1:
cout<<"the cake u selected is choclate";
price =1000;
cout<<"the price of the cake u selected is "<<price;
break;
case 2:
cout<<"the cake u selected is cheese";
price =1500;
cout<<"the price of the cake u selected is "<<price;
break;
case 3:
cout<<"the cake u selected is mousee";
price =2000;
cout<<"the price of the cake u selected is "<<price;
break;
case 4:
cout<<"the cake u selected is cofee";
price =2500;
cout<<"the price of the cake u selected is "<<price;
break;
default:
cout<<"the entry is invalid please do the selection again from the given menu";
}
cout<<"do u want to do the selection again ";
cin>>ans;
}while ((ans=='y')||(ans=='Y'));
cout<<"how many cakes u want to order ?"<<endl;
cin>>order;
total=price*order;
cout<<"your bill is of rupess ="<<total<<endl;
cout<<"please pay the bill of amount ="<<total<<endl;
cin>>useramount;
if (useramount>=total)
{
cout<<"*************************classic
cakeshop**************************"<<endl;
cout<<"\t""\t""\t""*******""BILL RECIPTE" "********""\t""\t""\t"<<endl;
cout<<"\t"<<"="<<total<<endl;
cout<<"amount paid ="<<useramount<<endl;
cout<<"change given ="<<(useramount-total)<<endl;
cout<<"THANK YOU FOR VISITING "<<endl;
}
if (useramount<total)
{
cout<<"the amount you enterd is inappropriate"<<endl;
cout<<"enter more amount ="<<total-useramount<<"to get the order"<<endl;
}
}
}