Problem

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

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

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

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

Reference:

In Programming Exercise 2, the class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date, in addition to the operations already defined:

a. Set the month.

b. Set the day.

c. Set the year.

d. Return the month.

e. Return the day.

f. Return the year.

g. Test whether the year is a leap year.

h. Return the number of days in the month. For example, if the date is 3-12-2013, the number of days to be returned is 31 because there are 31 days in March.

i. Return the number of days passed in the year. For example, if the date is 3-18-2013, the number of days passed in the year is 77. Note that the number of days returned also includes the current day.

j. Return the number of days remaining in the year. For example, if the dare is 3-18-2013, the number of days remaining in the year is 288

k. Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2013 and the days to be added are 25, the new date is 4-12-2013.

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
Solutions For Problems in Chapter 12
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