Question: (c++)ShowTicket Class using c++ Description A theatre sells seats for shows and needs a system to keep track of the seats they have sold tickets
(c++)ShowTicket Class
using c++
Description
A theatre sells seats for shows and needs a system to keep track of the seats they have sold tickets for. Define a class for a type called ShowTicket.
The class should contain fields for the row, seat number, and whether the ticket has been sold or not. Define a constructor which accepts as arguments the row and seat number and sets the sold status to false in the
constructor initialization section.
Include the following member functions:
- A function to check if the ticket has been sold with this signature: bool is_sold();
- A function to update the ticket status to sold with this signature: void sell_seat();
- A function to print the row, seat number, and sold status delimited by a space with this signature: string print_ticket();
An example use of your class follows:
int main () { ShowTicket myticket1(AA,101); ShowTicket myticket2(AA,102); if(!myticket1.is_sold()) myticket1.sell_seat (); cout << myticket1.print_ticket() << endl; cout << myticket2.print_ticket() << endl; return 0; }
The output from this sample would be:
AA 101 sold AA 102 available
File Name showticket.h
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
