Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Sport Ticket Class A football club needs a system to keep track of the seats they have sold tickets for. Define a class for a

Sport Ticket Class
A football club needs a system to keep track of the seats they have sold tickets for.
Define a class for a type called SportTicket that inherits from the ShowTicket class you
defined earlier. You should include the showticket.h file in your code but not upload the file.
The class should add a new boolean field to store if beer has been purchased at that seat. Define a constructor which accepts as arguments the row and seat number and sets the sold status and beer sold fields to false in the constructor initialization section.
The showticket class has the following protected members:
string row;
string seat;
Include the following new member functions:
A function to check if the ticket has been sold with this signature: bool beer_sold();
A function to update the beer sold status to sold with this signature: void sell_beer();
override the print_ticket method to add if beer has been sold or not.
An example use of your class follows:
int main (){
SportTicket myticket1(AA,101);
SportTicket myticket2(AA,102);
myticket1.sell_seat();
myticket2.sell_seat();
myticket2.sell_beer();
cout << myticket1.print_ticket()<< endl;
cout << myticket2.print_ticket()<< endl;
return 0;
}
The output from this sample would be:
AA 101 sold nobeer
AA 102 sold beer
File Name
sportticket.h
Note: You do not need to submit any other code including the main method or any print statements. ONLY the SportTicket class is required (The grader already has the ShowTicket class). Otherwise, the autograder will fail and be unable to grade your code. (I.e., do not include the above example in your code.)
The above example should be used to test your code but deleted or commented out upon submission.

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_2

Step: 3

blur-text-image_3

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 SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions