Menu

[solved]-Need Help Assignments Assignment 1 Programming Exercise 2 Class Datetype Designed Imple Me Q39037512

I need some help on these assignments

Assignment 1:

In Programming Exercise 2, the class dateType was designed andimple- mented to keep track of a date, but it has very limitedoperations. Redefine the class dateType so that it can perform thefollowing operations on a date, in addition to the operationsalready 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. Return the number ofdays in the month. For example, if the date is 3-12-2017, thenumber of days to be returned is 31 because there are 31 days inMarch

i. Return the number of days passed in the year. For example, ifthe date is 3-18-2017, the number of days passed in the year is 77.Note that the number of days returned also includes the currentday.

j. Return the number of days remaining in the year. For example,if the date is 3-18-2017, the number of days remaining in the yearis 288.

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

Assignment 2:

The class dateType defined in Programming Exercise 6 prints thedate in numerical form. Some applications might require the date tobe printed in another form, such as March 24, 2017. Derive theclass extDateType so that the date can be printed in either form.Add a member variable to the class extDateType so that the monthcan also be stored in string form. Add a member function to outputthe month in the string format, followed by the year—for example,in the form March 2017.

Thank you!

Expert Answer


Answer to I need some help on these assignments Assignment 1: In Programming Exercise 2, the class dateType was designed and imple… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *