im trying to creat a class called Date that includes data members: a month, a day and a year (all type int). that have a constructor with three parameters to initialize the three data members. i have to use a set and a get function for each data member and provide a member function displaydate that displays the month, day and year in separate by foward slashes all of these asuming the users enter the correct date. could you please take a look of what i have and tell me what do i have wrong and how to correct it.? this is for tomorrow can you please help?
// Create Date class
#include <iostream>
using std::cout;
using std::cin;
using std::endl;
// Date class definition
class Date
{
public:
//constructor initializes month, day and year
Date (int month, int day, int year)
{
setMonth (themonth)
setDay (theday)
setYear (theyear);
} // end Date constructor
// function that sets the month, day and year
void setMonth( int themonth)
{
Month = themonth; // store the month in the object
}
void setDay ( int theday)
{
Day = theday; //store the day in the object
}
void setYear ( int theyear)
{
Year = theyear; //store the year in the object
}
// function that gets the month, day and year
int getMonth()
{
return Month; // return the object's Month
}// end function getMonth
int getDay()
{
return Day; //return the object's Day
} //end function getDay
int getYear()
{
return Year; //return the object's Year
} //end function getYear
// function that displays the month, day and year
void displayDate(int displayDate)
{
// this statement calls getMonth, getDay, getYear to get the date
cout << "Enter the date" << getMonth() << getDay()<< getYear()
<< endl;
} // end function displayDate
// function main begins program execution
int main()
{
// create Date objects
Date month()
Date day()
Date year()
int month; // user enters the month
int day; // user enters the day
int year; // user enters the year
int displayDate; // display the date in month/day/year
Date myDate; // create a Date object named myDate
// display initial value of Month, Day and Year
cout << "Enter the month " << month.getMonth()
<<"/day"<<day.getDay()
<<"/year"<<year.getYear()
<< endl;
cin >> "Enter the date:"// user enters the full date
system ("pause");
return 0; // indicate successful termination
} // end main