Question
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
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:mmAM/PM as in 2:05 PM. Note: C++11 has the std::to_string() function which will allow you to convert integers into strings.
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. Your code should have no memory leaks. You will probably want a member function corresponding to each of the menu options 1-4 below.
Program Functionality
The program menu appears as follows:
Event Calendar for the Month of
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. The output should be well formatted.
Option 4 All information associated with every Event object in the month is displayed. The output should be well formatted.
Option 5 The program displays a good-bye message and then terminates.
Additional Information
The only object you should create in your main function is the Month object.
Your program must include at least one recursive function.
Time should be formatted appropriately: For example: 1:08 PM, not 1:8 PM
Each file in your project must have file header comments. Header comments should include your name, class, project number, and a short description of what the file does. Each header file should contain include guards.
Comment your code so whoever is reading it understands the intention.
Include appropriate error handling. This will also help you debug your code.
Format your code. Proper formatting makes more code readable and is essential to writing good software.
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