Question: You are tasked with creating a class called Event that represents various events with different attributes. Write a declaration for the Event class, including its
You are tasked with creating a class called Event that represents various events with different attributes. Write a declaration for the Event class, including its data members and function members, based on the following UML. Save the declaration in a file named Event.h Event title: string date: string type: int for Workshop, for Seminar, for Conference attendees: int Public Member Functions: Event Eventstring t Eventstring t string d int tp int a getTitle: string getDate: string getType: int getAttendees: int setTitlestring t: void setDatestring d: void setTypeint tp: void setAttendeesint a: void isWorkshopint tp: Boolean changeToConferenceint number: void equalsEvent e: Boolean reschedulestring newDate: void displayInfo: void b Implement the Member Functions Implement the member functions in a file called Event.cpp based on the following descriptions: Event: Default constructor, which will set title, date, type, and attendees to "General Meeting", for Seminar and Eventstring title: Constructor that sets the title to the given parameter, while date, type, and attendees default to Workshop and Eventstring title, string date, int type, int attendees: Constructor that sets all attributes to the provided values. getTitle: Returns the title of the event. getDate: Returns the date of the event. getType: Returns the type of the event. getAttendees: Returns the number of attendees. setTitlestring t: Sets the title to t setDatestring d: Sets the date to d setTypeint tp: Sets the type to tp setAttendeesint a: Sets the number of attendees to a isWorkshopint tp: Returns true if the type is Workshop. changeToConferenceint number: Asks the user if they want to change the event to a conference, where number specifies which event to change. equalsEvent e: Returns true if the title, date, and type of the current object match those of e reschedulestring newDate: Changes the date to newDate. displayInfo: Displays the events title, date, type, and number of attendees. c Write a Program MainEvent.cpp Create a program that uses the Event class as follows: Create an object event using the default constructor. Create an object event using the second constructor. Prompt the user for the title. Create an object event using the third constructor, prompting the user for title, date, type, and attendees. Display the details of all three events using displayInfo Check if each event event event event is a Workshop. If an event is not a Workshop, ask the user if they want to change it to a Conference. Create an integer array to store the number of attendees for each event. Display the total attendees across all events. Update the attendees for event to be the sum of attendees from event and event and then display the updated total attendees. Ask the user to reschedule event by providing a new date. Compare all three events event event and event to check if they are equal in terms of title, date, and type. Display appropriate messages based on the comparison. Print the final details of all events and end with a closing message. Enter event title for event: AI Workshop Enter event title for event: Cloud Computing Seminar
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
