Question
Please complete the following requirements (in bold) for each operation. Default constructor. Creates a date that represents the current date Date::Date() { } Parameters must
Please complete the following requirements (in bold) for each operation.
Default constructor. Creates a date that represents the current date Date::Date() { }
Parameters must represent a valid date. Constructor. Creates a date that represents the specified date. Date::Date(int day, int month, int year) throw (logic_error) { }
Getter for day of month. Returns the value of day
int Date::getDay() const { return -1; }
Getter for month. Returns the value of month.
int Date::getMonth() const { return -1; }
Getter for year. Returns the value of year.
int Date::getYear() const { return -1; }
Year is greater than 1901 A.D. Static method. If the specified year is a leap year, returns true. Else returns false. bool Date::isLeapYear(int year) { return false; }
Year is greater than 1901 A.D. (The formula we provide uses 1901 as a basis for calculation). Static method. Returns the number of days in the specified month.
int Date::daysInMonth(int month, int year) { return -1; }
Returns the number of days in the specified week.
int Date::getDayOfWeek() const { return -1; }
Please use C++ to complete the requirements.
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