Problem

The class dateType defined in Programming Exercise prints the date in numerical form. Some...

The class dateType defined in Programming Exercise prints the date in numerical form. Some applications might require the date to be printed in another form, such as March 24, 2003. Derive the class extDateType so that the date can be printed in either form.

Add a data member to the class extDateType so that the month can also be stored in string form. Add a function member to output the month in the string format followed by the year—for example, in the form March 2003.

Write the definitions of the functions to implement the operations for the class extDateType .

Programming Exercise

In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the data members. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the data members. Add a function member, isLeapYear , to check whether a year is a leap year. Moreover, write a test program to test your class.

Step-by-Step Solution

Request Professional Solution

Request Solution!

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

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
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