Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can anyone help me with this c++ program? This is an exercise in dynamic memory management, array management, linked-list management and class composition. You are

Can anyone help me with this c++ program?

This is an exercise in dynamic memory management, array management, linked-list management and class composition. You are to create a menu-driven event calendar. For simplicity, the application will track events for a single month. Your program will contain at a minimum the 3 user-defined classes - Month, Event and Time each having the following attributes and behaviors:

Class Time contains the starting time of a single event using three attributes: hour, minute and an am/pm indicator. Include the appropriate constructor(s), set functions and get functions. Set functions should verify attributes are within an appropriate range. Also, include a getTime member that returns a string containing the time in the format hh:mm AM/PM as in 2:05 PM.

Class Event contains the description of an event, a time object set to the events starting time and a pointer to the next Event object in a time-ordered linked-list. Include the appropriate constructor(s), set functions and get functions.

Class Month contains the name of the month, the number of days in that month, and a dynamically allocated array capable of tracking multiple linked-lists of events - one list for each day of the month. The primary responsibility of Month is to manage the linked-lists of Event objects. The Month constructor should initialize the month name and days-in-month attributes. It will also dynamically create a days-in-month element array of type Event* and initialize each array element to nullptr. You must include a destructor that deletes each Event object in existence.

Program Functionality The program menu appears as follows:

Event Calendar for the Month of . 1. Create an event.

2. Delete an event.

3. Display all events for a day.

4. Display all events for the month.

5. Exit program Enter choice:

Option 1 The program prompts the user for the day of the event, the time of the event and a description of the event. An Event object is dynamically created, initialized and inserted into the linked-list for that day. The position in the list is based on the events time.

Option 2 The program prompts the user for the day and time of the event that is to be deleted. The corresponding Event object is removed from the appropriate linked-list and the objects memory is freed.

Option 3 The program prompts the user for the day for which the events are to be displayed. All information associated with that days event list is displayed.

Option 4 All information associated with every Event object in the month is displayed.

Option 5 The program displays a good-bye message and then terminates.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

Students also viewed these Databases questions

Question

=+employee to take on the international assignment?

Answered: 1 week ago