Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write code in C++ ! The result should output as the same second picture Create DayOfYear class that has a friend function' equal'. 'equal' function
Write code in C++ !
Create DayOfYear class that has a friend function' equal'. 'equal' function will check the equality of two dates. class DayofYear \{ public: DayOfYear(); //Initializes the date to January first. DayOfYear(int tmonth, int tday); DayOfYear(); void setMonth(int tmonth); void setDay(int tday); int getMonth(); int getDay(); friend bool equal(DayOfYear date1, DayofYear date2); private: int month; int day; Enter today's month and day : 310 Enter your birthday (month and day) : 310 Today is 3/10 Birthday is 3/10 Happy 'Birthday' To You! Enter today's month and day : 215 Enter your birthday (month and day) : 317 Today is 2/15 Birthday is 3/17 Happy 'Unbirthday' To You The result should output as the same second picture
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