Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(c++)ShowTickets Class using c++ Description(this one is showtickets instead of showticket) A theatre sells seats for shows and needs a system to keep track of

(c++)ShowTickets Class

using c++

Description(this one is showtickets instead of showticket)

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

Familiarity with transmission substation equipment desirable

Answered: 1 week ago