Write the program that have the class dataType to implement the date in the program. Write the definitions of the function setDate, and the constructor so that the values of the month, day, and year are checked before storing the data into the data members. Add a function member, isLeapYear, to check whether the year is a leap year. The class dataType can perform the following operations on a date:
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 the days in the month. For example, if the date is 3-12-2011, the number of the days to be returned is 31, because there are 31 days in March.
i. Return the number of the days passed in the year. For example, if the date is 3-18-2011, the number of the 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 date is 3-18-2011, the number of days remaining in the year is 288.
k. Calculate the new date by adding a fix number of days to the date. For example, if the date is 3-18-2011 and the days to be added are 25, the new date is 4-12-2011.
Write a Review
Leave a reply Cancel reply
Ask Your Question
We have verified professionals who are ready to answer your question.
Save Time and Money
We choose experts who can quickly answer your question and that suit your budget.
Get Your Answer
Your satisfaction is 100% guaranteed. You can keep on asking questions until you get the answer you need.