Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 image text in transcribed
image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions