write a c++ function named larger() that returns the later date of any 2 dates p
ID: 3638136 • Letter: W
Question
write a c++ function named larger() that returns the later date of any 2 dates passed to it. i've compiled and attempted to run the program listed below, but im receiving a few errors. im having some isues trying to correct the errors but to no avail. am i missing something when compiling the information listed below? some assistance would be helpful on this matter thank you...#include <iostream>
#include <iomanip>
using namespace std;
struct Date
{
private:
int month;
int day;
int year;
public:
int aDate(int = 10, int = 9, int = 2005);
int bDate(int = 11, int = 3, int = 2005);
void setDate(int, int, int);
void showDate();
};
void Date::setDate(int mm, int dd, int yyyy)
{
int month = mm;
int day = dd;
int year = yyyy;
}
void Date::setDate(int mm, int dd, int yyyy)
{
month = mm;
day = dd;
year = yyyy;
return;
};
larger Date::findLastDate (Date & a, Date & b)
{
larger aDate = a.convrt();
larger bDate = b.convrt();
if (aDate >= bDate)
return aDate;
else
return bDate;
}
Explanation / Answer
#include #include using namespace std; class Date { private: int month; int day; int year; public: aDate(int = 10, int = 9, int = 2005); bDate(int = 11, int = 3, int = 2005); void setDate(int, int, int); void showDate(); }; Date::Date(int mm, int dd, int yyyy) { month = mm; day = dd; year = yyyy; }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.