subject

1. 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 member variables. 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 member variables. 2. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class.
3. 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-2017, 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-2017, 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 date is 3-18-2017, 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-2017 and the days to be added are 25, the new date is 4-12-2017.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
Match the following errors with their definitions. a. #name b. #value c. #ref d. 1. when a formula produces output that is too lengthy to fit in the spreadsheet cell 2. when you enter an invalid cell reference in a formula 3. when you type text in cells that accept numeric data 4. when you type in a cell reference that doesnโ€™t exist
Answers: 1
question
Computers and Technology, 24.06.2019 03:30
Explain the importance of html in web page designing in 20 sentences..
Answers: 1
question
Computers and Technology, 25.06.2019 08:20
With technology, information is sent to users based on their previous inquiries, interests, or specifications.
Answers: 2
You know the right answer?
1. In this chapter, the class dateType was designed to implement the date in a program, but the memb...
Questions
Questions on the website: 13722367