You will be building upon what you have made for an event planning system to create a Schedule class. You will be using the Time and Date classes while the Event class will now be used as an abstract class with derived classes Birthday and Concert. You will finish implementing the Schedule, Event, Birthday, and Concert classes.

Event Class

To make the Event class an abstract base class, you will declare some pure virtual functions. It is up to you to figure out what should and should not be a virtual function. Event will also need a virtual destructor. Hint: To figure out if a function should be virtual, think about derived classes using the function and if what they do should differ from each other based on what derived class they are called from.

All protected data members have their own get and set functions.

This class will also have one more protected string called type which specifies what type the derived class object is.

Birthday Class

This class is a derived class of the Event class. It has the private data member

string gifts

Constructor: The constructor for the Birthday class will take three strings, a time, and a date as input. The first is the description, the second is the location, third is time, fourth is date. and the fifth are the gifts.

Assigns type to be “birthday”.

The constructor has been provided for you.

printSummary: This function overrides Event’s printSummary function.The function will output to standard output with cout. There will be five lines that will be output:

The description

The location

The time

The date

The gifts

Karl’s birthday

Bounce house

Time: 13:30:0

Date: 14/3/2020

Gifts: bike, pillow

The end of the function should output an endl.

Concert Class

This class is a derived class of the Event class.

It has the private data member

int tickets

Constructor: The constructor for the Concert class will take two strings, a time, a date, and the number of tickets as input. The first is the description, the second is the location, third is time, fourth is date. and the fifth are the number of tickets.

Assigns type to be “concert”.

The constructor has been provided for you.

printSummary: This function overrides Event’s printSummary function. The function will output to standard output with cout. There will be five lines that will be output:

The description

The location

The time

The date

The number of tickets

Houston Symphony

Jones Hall Houston, TX

Time: 20:0:0

Date: 6/11/2021

Tickets: 2

The end of the function should output an endl.

Schedule Class

This class will be handling multiple events for us.

The data members the Schedule class has are:

int size

int numBd

int numC

Event* events[MAXNUMEVENTS]

Time time

Date date

The time and date represent today’s time and date in the schedule.

Constructor: Schedule’s constructor takes in a int for the number of events the Schedule object will have and a time and date for today.

Schedule(int numEvents, Time t, Date d);

The size data member is assigned numEvents. The events data member has its elements assigned to be nullptr.

setEvents: This function takes in an int variable s and an Event* const array named newEvents.

Assign s to size. Copy the elements from newEvents to our events array.

Each element of the events array must be assigned new addresses before copying the newEvents element’s events. You should check what other’s event element type is to properly assign a new address for either Birthday or Concert. Since the newEvents array is an Event* const array, you must cast the dereferenced element into either a Birthday or Concert reference when copying from newEvents’ array.

Destructor The destructor must free up the memory that the pointers have used.

Hint: You must loop through the events array and delete each element as each element is a pointer. Make sure they are not nullptr before deleting.

Copy Constructor: you must do a memberwise copy of of size, numBd, numC, time, and date. Finally, you may use the setEvents function to initialize the events array.

Copy Assignment Operator: similar to the copy constructor, make sure to assign events based on their type.

eventsFromInput: this function is provided for you. This function is what will be getting the event information from standard input. They are not ordered by time or date.

There will be 10 lines of information for each event.

The first will be the type of event. (Birthday or Concert)

The description

The location

The hours

The minutes

The seconds

The day

The month

The year

Either a string that are gifts for the Birthday class, or the number of tickets for the Concert class. When you get a birthday event, increment numBd. When you get a concert event, increment numC.

Example input:

birthday

Karl’s birthday

Bounce house

13

30

0

14

3

2020

bike, pillow

getFirstEventDate: this function returns the Date of the event that is the earliest in the Schedule object’s events array. You will have to compare the dates and time in the events array to do this. This function is given to you.

Date getFirstEventDate();

getLastEventDate: this function returns the Date of the event that is the latest in the Schedule object’s events array. You will have to compare the dates and time in the events array to do this. You can base this function off of what was done for the getFirstEventDate function.

Date getLastEventDate();

eventsPassed: this function returns the number of events that have already passed in the schedule. You will need to compare the events in the events array with the Schedule object’s time and date member variables which represent todays date and time.

printSummary: this function gives a brief overview of what is in the schedule and then outputs the events in the order given from input.

The output is formatted like:

“Today is ” [date] ” ” [time]

[first event’s date] “—” [last event’s date]

[events passed] ” events have passed.”

endl

printSummary of each event (birthday or concert) in the schedule.

Today is 2/2/2021 1:1:1

29/1/2021—14/3/2022

1 events have passed.

John’s birthday

Park

Time: 12:30:30

Date: 29/1/2021

Gifts: kite, bike

Kyogo

Minute Maid Park – Houston, Tx

Time: 18:30:0

Date: 13/11/2021

Tickets: 3

main.cpp

This has been provided for you. The first 7 lines from input will give:

The number of events

The hours

The minutes

The seconds

The day

The month

The year These allow us to make a Schedule obj in main. After the object is made, it must use the eventsFromInput function to get the events from standard input. Then if should call the printSummary function.

Order your essay today and save 30% with the discount code ESSAYSHELP