Question: (c++)ShowTickets Class using c++ Description(Please MATCH THE VARIABLE AND FUNCTION NAMES) A theatre sells seats for shows and needs a system to keep track of

(c++)ShowTickets Class

using c++

Description(Please MATCH THE VARIABLE AND FUNCTION NAMES)

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 ShowTickets.

The class should contain a collection field for the rows, seat numbers, and whether the tickets have been sold or not. Your class only needs to support 10 sold tickets. Assume a ticket you have not referenced before has a sold status of false.

Include the following member functions:

  1. A function to check if the ticket has been sold with this signature: bool is_sold(string row, string seat);
  2. A function to update the ticket status to sold with this signature: void sell_seat(string row, string seat);
  3. A function to print the row, seat number, and sold status delimited by a space with this signature: string print_ticket(string row, string seat);

An example use of your class follows:

int main () { ShowTickets myticket; if(!myticket.is_sold(AA,101)) myticket.sell_seat (AA,101); cout << myticket.print_ticket(AA,101) << endl; cout << myticket.print_ticket(AA,102) << endl; return 0; }

The output from this sample would be:

AA 101 sold

AA 102 available

File Name

showtickets.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!