Question: C + + Step 2 : Implement Member Functions Add four member functions to the Date class: getDay ( ) , getMonth (
CStep : Implement Member Functions
Add four member functions to the Date class: getDay getMonth getYear and setint d int m int y Ensure they are declared as public.Dateint m int d int yanother constructor with parameters month m; day d; year y;int getDay return day;int getMonth return month; int getYearreturn year;
assigns all values to private data members
void setint m int d int y
month m;
day d;
year y;
private:
int month;
int day;
int year;
;
Date yesterday; call constructor with singleparameterDate tomorrow;tomorrow.set; sets nd variable's membersDate afterTomorrow new Date;cout yesterday.getMonth yesterday.getDay yesterday.getYear endl;cout today.getMonth today.getDay
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
