You are on page 1of 2

Bill

============================================
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
clrscr();
int product=1,quantity;
float result,total=0;

cout<<"1-Product1 ($2.98\)\n\n2-Product2 ($4.50)\n\n3-


Product3 ($9.98)\n\n4-Product4 ($4.49)\n\n5-Product5
($6.87)\n\n";

while (product!=0)
{
cout<<"Enter Product Code (0 to exit): ";
cin>>product;

if (product==1)
{
cout<<"Enter Product1 Quantity: ";
cin>>quantity;
result=2.98*quantity;
total=total+result;

}
else if (product==2)
{
cout<<"Enter Product2 Quantity: ";
cin>>quantity;
result=4.50*quantity;
total=total+result;

}
else if (product==3)
{
cout<<"Enter Product3 Quantity: ";
cin>>quantity;
result=9.98*quantity;
total=total+result;
}
else if (product==4)
{
cout<<"Enter Product4 Quantity: ";
cin>>quantity;
result=4.49*quantity;
total=total+result;

}
else if (product==5)
{
cout<<"\nEnter Product5 Quantity: ";
cin>>quantity;
result=6.87*quantity;
total=total+result;

}
cout<<"\n\n--------------------------------------------------------------";
cout<<"\n\n Your Total Bill: "<<total ;
cout<<"\n\n--------------------------------------------------------------";
getch();
}

http://www.ravianeducation.blogspot.com
FARHAN: 03008855006