Wednesday, November 2, 2011

::::|| VU ||:::: Re: MTH202 ASSIGNMENT 01 solution Complete Fall 2011

ooooops ye wali hai

download kr le attached file

On Wed, Nov 2, 2011 at 6:28 PM, True Angel <verytrueangel@gmail.com> wrote:

VUClub.net

CS201 Assignment#1 Idea Solution


#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;

}
}


--














--











--
For study materials, past papers and assignments,
Join VU School at www.VusCool.com
and www.VUGuys.com
CoooL Virtual University Students Google Group.
To post to this group, send email to coool_vu_students@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/coool_vu_students?hl=en

No comments:

Post a Comment