Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started