Question: i need help pls Instructions In this chapter, the class dateType was designed to implement the date in a program, but the member function setDate

i need help pls  i need help pls Instructions 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

Instructions 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. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class. Input should be format month day year with each separated by a space. Output should resemble the following: Date \#: month-day-year An example of the program is shown below: Date 1: 3-15-2008 this is a leap year If the year is a leap year, print the date and a message indicating it is a leap year, otherwise print a message indicating that it is not a leap year. The header file for the class dateType has been provided for you. Grading When you have completed your program, click the Submit button to record your score. This week I was looking at student submissions that would not pass the Chapter 11 Codey tests. There are two things that I found that were an issue that I forgot about. One is that you do not want to add an endl to the output of the date. That causes it to fail. The other is that you do not want to set the variables in the constructor because it will set them to incorrect values when testing. You need to make the constructor call the setDate function so that it will correct incorrect date values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!