Question: Below is a program that enters a date in to the system. Copy this information in to a file ( * . cpp ) Using
Below is a program that enters a date in to the system.
Copy this information in to a file cpp
Using comments indicate the behaviors of the class Date.
Using comments indicate the attributes of the class Date.
Using comments indicate the instance of the class Date.
Modify this program to display the date as MonthDayYear
Add three Accessor functions for Date that returns the respective member values.
getMonth getDay& getYear
Add three Mutator functions for Date that modifies the respective member values.
setMonth setDay& setYear
Add a "default" constructor function that will set the initial date to
Add a parameterized constructor initialize the values of date, month & year of a new instance.
Add another behavior to the class that will display the year anniversary date. and call from main function
Create another instance of the Date class using the parameterized constructor and demonstrate all the behaviors from main
Add a destructor to this class that will set all member values to #include
using namespace std;
class Date
public :
void setDateintint,int;
void displayDate;
private:
int month;
int day;
int year;
;
void Date::setDateint num int numint num
if num num num;
month num;
if num num num;
day num;
year num;
void Date::displayDate
coutanvmn;
cout"Enter the day of the month: ;
cinanvday;
cout"Enter the year: ;
cinanvyr;
anvsy.setDateanvmnanvday,anvyr;
cout
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
