Include the larger() function in the complete program listed below. Store the Da
ID: 3637794 • Letter: I
Question
Include the larger() function in the complete program listed below. Store the Date structure returned by larger() in a seperate Date structure and display the member values of the returned Date.#include <iostream>
#include <iomanip>
using namespace std;
class Date
{
private:
int month;
int day;
int year;
public:
aDate(int = 1, int = 28, int = 2012);
bDate(int = 2, int = 1, int = 2012);
void setDate(int, int, int);
void showDate();
};
Date::Date(int mm, int dd, int yyyy)
{
month = mm;
day = dd;
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
Date::Date(int mm, int dd, int yyyy) { month = mm; day = dd; 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; }