Question
Create a class that simulates a school calendar for a course and has a warner that provides the school administration with the option of warning
Create a class that simulates a school calendar for a course and has a warner that provides the school administration with the option of warning students when the last day is that a student is permitted to drop the course. (Allow administrators to warn or not, as they wish. Do not make this a required function.)
You will assume in this calendar that there are 12 months in a year, 4 weeks in a month, and 7 days in a week. You can represent any day by 3 numbers. For example 12/3/2 would represent the 2nd day in the 3rd week of the 12th month. In this class you should:
-
Store a calendar day in terms of month, week, and day. (You should represent the month from 1 to 12, week from 1 to 4, and day from 1 to 7.)
-
Initialize the calendar to a specified day. (For example, you can initialize the calendar to 1/1/1.)
-
Allow the calendar to increment to the next day. (Hint: You need to take into account things such as whether the calendar is at the 3rd week, 6th day. Then you may need to consider iterated if statements.) In addition, you need to prevent the possibility of going beyond the 12th month, 4th week, and 7th day.
-
Set the warner and have the warner print out "TODAY IS THE LAST DAY TO DROP THE COURSE" when the set date is reached. (Hint: You may wish to create a private function that provides the wished-for printout when the date is reached and the warner is on.)
-
Display the present date.
-
Use the class in a program that uses the functions requiring displaying of time and setting of the warner.
Include 2 constructors. One constructor should be the default constructor that will initialize the object to 1/1/1. The second constructor should take parameters for months, weeks, and days. Both constructors will provide the private members with the date. In addition, have both constructors set the warner as off. (You will need a Boolean attribute that determines whether the warner is on or off. The administrators have the option of using the warner. They do not have to provide a warning to students if they do not wish to. In fact, the constructor should set the default as the warner is off and will not provide a warning to students.) The function or method you use to set the warner will set the warner on. (Hint: Have the class also have attribute of month, week, and day and the ability to be on or off with a Boolean variable for the warner.)
C++ Programming language, please add comments in code.
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