Question: C++ HW_7ab (2 parts) HW_7a -Date class & Passing objects to a function. - Create 3 Files: Date.h, Date.cpp, and main.cpp File: Date.h Create a

 C++ HW_7ab (2 parts) HW_7a -Date class & Passing objects to

a function. - Create 3 Files: Date.h, Date.cpp, and main.cpp File: Date.h

Create a class Date - Private data members (all ints): month, day,

and year - Methods: o Default Constructor No parameters are passed from

C++

HW_7ab (2 parts) HW_7a -Date class & Passing objects to a function. - Create 3 Files: Date.h, Date.cpp, and main.cpp File: Date.h Create a class Date - Private data members (all ints): month, day, and year - Methods: o Default Constructor No parameters are passed from main(), when an object is declared. The constructor sets data members to safe values Overloaded Constructor (another constructor with parameters) o - At the time an object is declared, tree parameters are passed from main) o Destructor o setDate - void-returning Month, day, and year values from main() are passed to this method The values are assigned to an object's data members o addDays void-returning One or more days can be added to the date . A value representing the number of days to be added is passed from main The values are assigned to an object's data members An if-else structure is used to update the date. Important: To keep it simple, assume that each of the twelve months have 30 days Ex: If the date is January 28h, and 4 days are added, then the date is changed to February 2nd... (as we will assume that January has 30 days) Ex: If the date is December 30, 2007. and 1 day is added, then the date is changed to January 1st 2008. (Again, we are assuming all months have 30 days.) o displayDate void-returning " No parameters are passed from main() An object's date is output to the screen. The values can be used in main()

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!