Wednesday, 26 July 2017

program of class GST

#include<iostream.h>
#include<conio.h>
#include<STDIO.h>
class GST
{ public:
char name[20];
int nop,choice;
float dis,amount,gst,tprice;
void indata();
void outdata();
void cal();
float cal2();

};
void GST::indata()
{
cout<<"enter the name \n";
gets(name);
cout<<"enter the total number of people\n";
cin>>nop;
cout<<"enter the  price \n";
cin>>amount;
cal();
tprice=cal2();
}
void GST::outdata()
{
cout<<" name is ";
puts(name);
cout<<" total number of people ";
cout<<nop<<"\n";
cout<<" price  is";
cout<<amount<<"\n";
cout<<"discount is "<<dis<<"\n";
cout<<"gst is "<<gst<<"\n";
cout<<"total price "<<tprice<<"\n" ;
cout<<"THANK YOU FOR COMING \n";
}
void GST::cal()
{
int a=amount;
if(a<500)
{
dis=3;
gst=8;
}
else if((a>500)&&(a<1000))
{
dis=5;
gst=16;
}
else if((a>1000)&&(a<2500))
{
dis=8;
gst=28;
}
else if(a>2500)
{
dis=10;
gst=28;
}
else
{
cout<<" ";
}


}
float GST::cal2()
{
  int  a;
  int b;
  int c;
  a=(amount*(dis/100));
  b=(amount*(gst/100));
  c=amount+b-a;
  return c;
}
void main()
{
 clrscr();
int a;
cout<<"\t\tWELCOME  TO THE RESTURANT \n";
cout<<" do you want to get inside\n";
cout<<" if yes press 1 \n if not press 2\n";
cin>>a;
if(a==1)
{
GST g1;
g1.indata();
g1.outdata();
}
else if(a==2)
{
cout<<"THANK YOU COME NEXT TIME\n";
}
else
{
cout<<"wrong choice ";
}
getch();

}

No comments:

Post a Comment