Create a class movie for ticket booking with data members theatrename, date, moviename, screenno, amount, no_of_tickets and total_amount and include functions reservation() , bookiing_details().
Create dynamic object and display ticket booking details.
#include <iostream>
#include <unistd.h>
#include <stdlib.h>
using namespace std;
class CINEPLEX{
public:
int x=1;
int y=2;
int z=3;
string X="X";
string Y="Y";
string Z="Z";
void display(){
cout<<"\n\nMovies Available Time Price"<<endl;
cout<<"1. "<<X<<" a "<<x<<endl;
cout<<"2. "<<Y<<" b "<<y<<endl;
cout<<"3. "<<Z<<" c "<<z<<endl<<endl<<endl;
}
void deal(){
int choice;
char c;
cout<<"Please select your query: ";
cin>>choice;
if(choice==1)
cout<<"You selected "<<Y<<" for the price "<<y<<endl;
if(choice==2)
cout<<"You selected "<<Y<<" for the price "<<y<<endl;
if(choice==3)
cout<<"You selected "<<Z<<" for the price "<<z<<endl;
cout<<"Confirm Y/N ?"<<endl;
cin>>c;
if(c=='Y')
cout<<"\nOrder Booked"<<endl<<endl;
else
cout<<"\nOrder Canceled"<<endl<<endl;
}
};
int main() {
CINEPLEX c1,c2;
c1.display();
c1.deal();
cout << flush;
printf("\e[1;1H\e[2J");
usleep(3000000);
c2.display();
c2.deal();
return 0;
}
Comments
Leave a comment