#include<iostream.h>
#include<conio.h>
#include<process.h>
class ticket
{
long int n;
float sum;
public:
ticket ()
{
n=0;
sum=0.0;
}
void people_no()
{
n++;
}
void people_ticket()
{
n++;
sum=sum+2.50;
}
void display()
{
cout<<"\nthe no. of persons are="<<n;
cout<<"\nthe total sum is="<<sum;
}
void display_ticket()
{
float total;
total=sum/2.50;
cout<<"\nthe total no. of tickets"<<total;
}
};
void main()
{
clrscr();
int n;
ticket t;
while(1)
{
cout<<"\n1. if person visited";
cout<<"\n2. for person has also bought the ticket";
cout<<"\n3. for display of total no of persons and sum";
cout<<"\n4. for display the total no. of tickets";
cout<<"\n5. for exit";
cout<<"\nenter the choice";
cin>>n;
switch(n)
{
case 1:
t.people_no();
break;
case 2:
t.people_ticket();
break;
case 3:
t.display();
break;
case 4:
t.display_ticket();
break;
case 5:
exit(0);
default:
cout<<"wrong choice";
}
}
}