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:

  1. A function to check if the ticket has been sold with this signature: bool is_sold();
  2. A function to update the ticket status to sold with this signature: void sell_seat();
  3. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!