Can anyone help me with this constructor problem?
In main:
instantiate one date object (date1) using the default constructor
just to see that the constructor works, print the month, day, and year of date1 using the getters
get input from the user and use the setters to set the values of date1
get input from the user and use the constructor with three arguments to instantiate date2
print both objects using printDate
print a message to say if the two months are the same (testing the sameMonth function)
I cannot figure out how to work out the BOLD part in the question. Here is my main.cpp code so far.
#include "Date.h"
#include <iostream>
using namespace std;
int main()
{
Date date1;
string Date_month;
string Date_month2 = " ";
int inDay2 = 0;
int inDay;
int inYear;
int inYear2 = 0;
cout << "Test to see constructor works:" << endl;
date1.printDate();
cout << endl;
cout << "********************************************************" << endl;
// For date1
cout << "Enter the month: ";
getline(cin, Date_month, '\n');
date1.setMonth(Date_month);
cout << "Enter the day: ";
cin >> inDay;
date1.setDay(inDay);
cout << "Enter the year: ";
cin >> inYear;
date1.setYear(inYear);
date1.printDate();
// For date2
Date date2("September", 23, 2012);
cout << endl;
cout << "Enter the second month: " << endl;
getline(cin, Date_month2, '\n');
date1.setMonth(Date_month);
cout << "Enter the second day: ";
cin >> inDay2;
date2.setDay(inDay2);
cout << "Enter the second year: ";
cin >> inYear2;
date1.setYear(inYear2);
date2.printDate();
}