Tuesday, 31 July 2018

Billing

===========================================================================
                                CODING



#include<iostream.h>
#include<conio.h>
#include<math.h>
#include<string.h>
#include<stdio.h>

void main()
{
long n,q,m,price,note1,note2,nnote1,nnote2;
float tprice,cashback;
char pro[30],name[20],address[100],confirm;
clrscr();
cout<<"Billing:- \n Enter your Name: ";
cin>>name;
cout<<"\n Available products:- ";
cout<<"\n  [1] A.C.";
cout<<"\n  [2] Fridge";
cout<<"\n  [3] Washing Machine";
cout<<"\n  [4] T.V.";
cout<<"\n\n¯ Enter The Product Bought:- ";
cin>>q;
switch(q)
{
case 1:strcpy(pro,"AC");
price=40000;
note1=2000;
note2=500;
nnote1=20;
nnote2=0;
break;
case 2:strcpy(pro,"Fridge");
price=15000;
note1=2000;
nnote1=7;
note2=500;
nnote2=2;
break;
case 3:strcpy(pro,"Washing Machine");
price=20000;
note1=2000;
nnote1=10;
note2=500;
nnote2=0;
break;
case 4:strcpy(pro,"TV");
price=80000;
note1=2000;
nnote1=40;
note2=500;
nnote2=0;
break;
default: cout<<"Wrong Input!!";
}
cout<<"\n Enter Address: ";
gets(address);
cout<<"\n Available Mode of Payment:- ";
cout<<"\n  [1] Cheque";
cout<<"\n  [2] Cash";
cout<<"\n  [3] Credit EMI";
cout<<"\n  [4] Credit  No EMI";
cout<<"\n\n¯ Enter Mode of Payment:- ";
cin>>n;
switch(n)
{
case 1:
cout<<"\n Enter cheqe no.: ";
cin>>m;
tprice=0.18*price+price;
cout<<"\n"<<name<<" you have bought a "<<pro<<". \nYour Address is "<<address<<".\nThe Total amount to be paid= "<<tprice<<"Rs. (inluding GST) under cheque no.: "<<m;
cout<<"\nIF all the details are correct enter Y, if not enter N: ";
cin>>confirm;
if(confirm==89)
{cout<<"\nThank you for Shopping with us";
}
else if(confirm==78)
{cout<<"\nPlease Restart Programme";}
break;
case 2:
tprice=0.18*price+price;
cout<<"\n"<<name<<" you have bought a "<<pro<<". \nYour Address is "<<address<<".\nThe Total amount to be paid= "<<tprice<<"Rs. (inluding GST) in Cash";
cout<<"\nIF all the details are correct enter Y, if not enter N: ";
cin>>confirm;
if(confirm==89)
{cout<<"\nThank you for Shopping with us";
cout<<"\nThe payment is recieved in form of:- ";
cout<<"\n\tValue\tNumber of Notes";
cout<<"\n\t"<<note1<<"\t     "<<nnote1;
cout<<"\n\t"<<note2<<"\t     "<<nnote2;
}
else if(confirm==78)
{cout<<"\nPlease Restart Programme";}
break;
case 3:
tprice=0.12*price+0.18*price+price;
cout<<"\n"<<name<<" you have bought a "<<pro<<". \nYour Address is "<<address<<".\nThe Total amount to be paid= "<<tprice<<"Rs. (inluding GST[18%] and EMI[12%]) under Credit with EMI";
cout<<"\nIF all the details are correct enter Y, if not enter N: ";
cin>>confirm;
if(confirm==89)
{cout<<"\nThank you for Shopping with us";
}
else if(confirm==78)
{cout<<"\nPlease Restart Programme";}
break;
case 4:
tprice=0.12*price+0.18*price+price;
cout<<"\n"<<name<<" you have bought a "<<pro<<". \nYour Address is "<<address<<".\nThe Total amount to be paid= "<<tprice<<"Rs. (inluding GST) under Credit with no EMI";
cout<<"\nIF all the details are correct enter Y, if not enter N: ";
cin>>confirm;
if(confirm==89)
{cashback=0.05*price;
cout<<"\nYou will get a cashback of "<<cashback<<"Rs. within 24 hours. \nThank You For Shopping With Us";
}
else if(confirm==78)
{cout<<"\n Please Restart Programme";}
break;
default: cout<<"Wrong input!!!!";
}
getch();
}



===========================================================================


                                OUTPUT



No comments:

Post a Comment