79.1k views
3 votes
C++

The current program with the following code is handling the concert ticket inventory for a 21-day concert series. For each concert, there are three types of tickets for sale and a set number of tickets of each type: Artist's Circle (25 seats), Main Floor (400), and Balcony (200).
The current menu interactions are:
D – Display Inventory – Prompt the user for a day number (1 to 21)
S – Sell Tickets – Prompt the user for a day number (1 to 21) and continue to input
until a number 1 to 21 is entered.
R – Report – Display the day number and number of tickets of each type for all 21
concert days.
Q – Quit the program.
Make changes to the program so that it meets the following requirements:
1. Without changing your original base class in any way, use inheritance to create a new class with the following features:
a. A private data item to store the name of the host city for the concert
b. A default constructor that will assign "Stockholm" to the host city name
c. A method that sets the name of the host city (passed as a parameter)
d. An overridden function to display all three ticket quantities for a concert, but
with the name of the host city included as well

1 Answer

4 votes

Final answer:

To meet the given requirements, create a new class that inherits from the base class. Add a private data item for the host city, a default constructor, a method to set the host city name, and an overridden function to display ticket quantities with the host city name.

Step-by-step explanation:

In order to meet the given requirements, you will need to create a new class that inherits from the base class. This new class should have a private data item to store the name of the host city, a default constructor that assigns 'Stockholm' to the host city name, a method to set the name of the host city, and an overridden function to display all three ticket quantities for a concert with the name of the host city included.

User Gujarat Santana
by
8.2k points