Question: Question 4 Consider the following class declaration: 4 COS 1 5 1 2 / 1 0 3 / 2 0 2 4 5 Implement and
Question
Consider the following class declaration:COSImplement and test the Date class, taking the following guidelines into account:a The default constructor should initialise the date to September b The overloaded constructor should initialise the date with the given day, month and year.c The functions getDay getMonth and getYear should return the current day, month and year respectively.d The functions setDay setmonth and setYear should change the current day, month or year to the given value.e The operator should advance the date by one, and return the new date.f The operator should set the date back by one day, and return the new date.g The operator should calculate whether the receiving date object left argument precedes the parameter date right argumentFor example, Date Dateh The private member function monthLength should return the length of the current month, taking into account leap years. A year is a leap year if it is either i divisible by but not by or ii divisible by In a leap year, February has days, otherwise it has days.i Also overload the insertion operator to output a date to the screen. For example, the date in a above should be written as: September Test the Date class in a C program that will do the following:
Declare a new Date object called d
Display the day, month and year of on the screen.
Change the date to February
Advance this date by one and display the new date on the screen.
Now change the date to January please answer in c only
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
