Answer to Question #183044 in C++ for Smith

Question #183044

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.


1
Expert's answer
2021-04-20T05:31:50-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS