Question
C. (40 points) Define a new class called Event using class composition. The class Event consists of four private member variables: string name string location
C. (40 points) Define a new class called Event using class composition. The class Event consists of four private member variables: string name string location Date date Time time The class Event should also include the following public member functions: 1. print to print the even name, location, date, and time information. 2. setEvent to set the event name, location, date, and time using two string parameters, one Date parameter, and one Time parameter. 3. setEventName to set the event name according to the parameter. 4. getEventName to return the event name. 5. setLocation to set the event location according to the parameter. 6. getLocation to return the event location. 7. setDate to set the event date using a Date object. 8. getDate to return the date, a Date object. 9. setTime to set the event time using a Time object. 10. getTime to return the time, a Time object. 11. equalEventDate to compare two event dates. Return true if they are the same, otherwise, return false. 12. A default constructor to initialize name and location to None. (The default constructor of Date and Time will be automatically invoked.) 13. An overloaded constructor that initializes name, location, date, and time according to the parameters (two string parameters, one Date parameter, and one Time parameter). D. (20 points) In the client program, you should write statements to test your class implementation including the following functions in the Event class: default constructor, overloaded constructor, mutator functions, accessor functions, and equalEventDate function. : You should submit a ZIP file that contains seven files on the following names: Time.h Time.cpp Date.h Date.cpp Event.h Event.cpp hw4main.cpp.
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