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. isLeap Year. 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
Programming Exercise 11-2
dateType.h file provided![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.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F20524a65-d93c-47cb-bacb-a6696a50ab40%2F0a532836-0682-420a-b0ad-56487dd2f873%2Fenhtm7_processed.png&w=3840&q=75)
![Tasks
Date is validated correctly
>](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F20524a65-d93c-47cb-bacb-a6696a50ab40%2F0a532836-0682-420a-b0ad-56487dd2f873%2Fv54c2q_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
I also am struggling with this project but do not understand this code. The problem I have uses a main.cpp file alongside a dateTypelmp.cpp file. This solution does not solve the task as I understand it to be.
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.
Function setDate and the constructor need to be rewrit so that the values for the month, day, and year are checked before storing the date into the member variables. A member function should be included, isLeapYear, to check whether a year is a leap year.
Input should be format month day year with each separated by a space. Output should resemble the following:
Date #: month-day-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.
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)