Question

In C++ Consider the following Date class: #include <iostream> using namespace std; class MyDate { private:...

In C++

Consider the following Date class:

#include <iostream>

using namespace std;

class MyDate

{

private:

int month, day, year;

public:

MyDate() {setDate(2,27,2006);}

MyDate(int, int, int);

void setDate(int mm, int dd, int yyyy);

void showDate();

};

MyDate::MyDate(int mm, int dd, int yyyy)

{

month = mm;

day = dd;

year = yyyy;

};

void MyDate::setDate(int mm, int dd, int yyyy)

{

month = mm;

day = dd;

year = yyyy;

};

void MyDate::showDate()

{

cout << "The date is " << month << "/" << day << "/" << year% << endl;

};

END HERE...

Write a test main that will create two date instances date1 inititalized to April, 17, 2012 and date2 that is set to today, then show both dates with each display on its own line.

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
In C++ Consider the following Date class: #include <iostream> using namespace std; class MyDate { private:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT