Answered step by step
Verified Expert Solution
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 beersold;
A function to update the beer sold status to sold with this signature: void sellbeer;
override the printticket method to add if beer has been sold or not.
An example use of your class follows:
int main
SportTicket myticketAA;
SportTicket myticketAA;
myticketsellseat;
myticketsellseat;
myticketsellbeer;
cout myticketprintticket endl;
cout myticketprintticket endl;
return ;
The output from this sample would be:
AA sold nobeer
AA 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. Ie 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started