Leap year calculator while practicing class. I get an error at display portion
1. Create a class named Date
2. Class has 3 private data items (name the data items month, day, year)
a. int month
b. int day
c. int year
3. Member functions
a. ‘getters’ a getter for each data item
i. Use ‘get’ and the data items name
ii. Return the data item
iii. int getMonth() {return month;}
b. ‘setters’ a setter for each data item
i. Use ‘set’ and the data items name
ii. Change the data items value
iii. Void setMonth(int x) {month = x;}
c. bool calcLeapYear()
i. uses the month, day, and year and determines if the year is a leap year
ii. calc
1. year evenly divisible by 400 is a leap year
2. year evenly divisible by 100 is not a leap year
3. year divisible by 4 is a leap year
4. else is not a leap year
d. display()
i. blank line
ii. month is mm
iii. day is dd
iv. year is yyyy
v. yyyy is (not) a leap year
4. in main, test your class and the member functions
cout << endl;
cout << "The month is " << month << endl;
cout << "The day is " << day << endl;
cout << "The year is " << year << endl;
bool calcLeapYear(year);
if (calcLeapYear == true)
{
cout << year << "is a leap year" << endl;
}
else
{
cout << year << "is not a leap year" << endl;
}
Now it complies, but when I run it closes right away.