orrect and complete the following program. If the user inputs: 2002 5 25 , the output should be: ----------------- My date is May 25, 2002. ---------------------- Note: your program should be able to accommodate any date. Hint: use case statements to output month names. Submit the correct code and the running result.
orrect and complete the following
If the user inputs:
2002
5
25
, the output should be:
-----------------
My date is May 25, 2002.
----------------------
Note: your program should be able to accommodate any date.
Hint: use case statements to output month names.
Submit the correct code and the running result.
#include <iostream>
using namespace std;
class Date {
public:
int year;
private:
int month;
int day;
public:
int getYear() {
return year;
}
int getMonth() {
return month;
}
int getday() {
return day;
}
void setYear(int y) {
return year = y;
}
void setMonth(int m) {
month=m;
}
void setday(int d) {
return day = d;
}
};
int main() {
Date myDate;
myDate.input();
myDate.output();
return 0;
}

Step by step
Solved in 2 steps with 1 images









