#include<iostream.h>
#include<conio.h>
#include<stdlib.h>
class theatre
{
int cost,seat,t_cost; char *ac;
public:
theatre()
{
cost=10;
cout<<"\n Enter the no.of seats required:";
cin>>seat;
t_cost=cost*seat;
cout<<"\nTicket cost of " <<seat<< " seats is Rs."<<t_cost;
}
theatre(int a)
{
seat=a;
cost=100;
t_cost=cost*seat;
cout<<"\n Ticket cost of " <<seat<< " seats is Rs."<<t_cost;
}
theatre(int a,char *b)
{
seat=a;
ac=b;
cost=100;
cost=cost+50;
t_cost=seat*cost;
cout<<"\n"<<ac;
cout<<"\n Ticket cost of "<<seat<<" seats is Rs."<<t_cost;
}
};
void main()
{
int n,ch;
clrscr();
cout<<"\t\t\t\tMAGNA THEATRE\n";
cout<<"\t\t\t\t*************";
cout<<"\n 1.Low Class - Rs.10/seat";cout<<"\n 2.Middle Class- Rs.100/seat";
cout<<"\n 3.High Class - Rs.150/seat";
do
{
cout<<"\n\n Enter the class you prefer:";
cin>>ch;
switch(ch)
{
case 1:
cout<<"\n\t LOW CLASS";
theatre t; break;
case 2:
cout<<"\n\n\t MIDDLE CLASS";
cout<<"\n Enter the no.of seats required:";
cin>>n;
theatre t1(n);break;
case 3:
cout<<"\n\n\t HIGH CLASS";
cout<<"\n Enter the no.of seats required:";
cin>>n;
theatre t2(n,"High class A\C");break;
default:
exit(0);
}
}while(ch<=3);
getch();
}
Comments
Post a Comment