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 //1 for Workshop, 2 for Seminar, 3 for Conference attendees: int Public Member Functions: Event() Event(string t) Event(string t, string d, int tp, int a) getTitle(): string getDate(): string getType(): int getAttendees(): int setTitle(string t): void setDate(string d): void setType(int tp): void setAttendees(int a): void isWorkshop(int tp): Boolean changeToConference(int number): void equals(Event e): Boolean reschedule(string 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", "2023-01-01",2(for Seminar), and 50. Event(string title): Constructor that sets the title to the given parameter, while date, type, and attendees default to "2023-03-01",1(Workshop), and 10. Event(string 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. setTitle(string t): Sets the title to t. setDate(string d): Sets the date to d. setType(int tp): Sets the type to tp. setAttendees(int a): Sets the number of attendees to a. isWorkshop(int tp): Returns true if the type is Workshop. changeToConference(int number): Asks the user if they want to change the event to a conference, where number specifies which event to change. equals(Event e): Returns true if the title, date, and type of the current object match those of e. reschedule(string 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: 1. Create an object event1 using the default constructor. 2. Create an object event2 using the second constructor. Prompt the user for the title. 3. Create an object event3 using the third constructor, prompting the user for title, date, type, and attendees. 4. Display the details of all three events using displayInfo().5. Check if each event (event1, event2, event3) is a Workshop. If an event is not a Workshop, ask the user if they want to change it to a Conference. 6. Create an integer array to store the number of attendees for each event. Display the total attendees across all events. 7. Update the attendees for event2 to be the sum of attendees from event1 and event3, and then display the updated total attendees. 8. Ask the user to reschedule event1 by providing a new date. 9. Compare all three events (event1, event2, and event3) to check if they are equal in terms of title, date, and type. Display appropriate messages based on the comparison. 10. Print the final details of all events and end with a closing message. Enter event title for event2: AI Workshop Enter event title for event3: Cloud Computing Seminar

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!