Answer:
#include <iostream>
bool validateDate(int, int, int);
using namespace std;
int main()
{
int year;
int month;
int day;
const int MIN_YEAR = 0, MIN_MONTH = 1, MAX_MONTH = 12, MIN_DAY = 1, MAX_DAY = 31;
bool validDate = true;
cout<<"Enter the year"<<endl;
cin>>year;
cout<<"Enter the month"<<endl;
cin>>month;
cout<<"Enter the day"<<endl;
cin>>day;
if(year <= MIN_YEAR) // invalid year
validDate = false;
else if (month < MIN_MONTH || month > MAX_MONTH) // invalid month
validDate = false;
else if (day < MIN_DAY || day > MAX_DAY) // invalid day
validDate = false;
if(validDate == true)
{
// Output statement
cout<<month<<"/"<<day<<"/"<<year<<"is a valid date"<<endl;
}
else
{
// Output statement
cout<<month<<"/"<<day<<"/"<<year<<" is an invalid date"<<endl;
}
}
Explanation: