Create a class date, each object is a value represented the day in the year in form year, month, day. Provide a constructor that enables an object of this class to be initialized when it is instantiated. The constructor should contain default values in case no initializes are provided. Provide Public member functions for each of the following operations: set the day, set the month, set the year, set the date, print the date in the form yyyy, mm, dd , increment the date by one day, increment the date by one month, compare two dates for equality, and final determine if one date is “less than” (comes before) another date. Include any additional operations that you think would be useful for your class. Design, implement, and test your class
Create a class date, each object is a value represented the day in the
year in form year, month, day. Provide a constructor that enables an
object of this class to be initialized when it is instantiated. The
constructor should contain default values in case no initializes are
provided.
Provide Public member functions for each of the following
operations: set the day, set the month, set the year, set the date, print
the date in the form yyyy, mm, dd , increment the date by one day,
increment the date by one month, compare two dates for equality,
and final determine if one date is “less than” (comes before) another
date.
Include any additional operations that you think would be useful for your
class.
Design, implement, and test your class
Step by step
Solved in 2 steps with 1 images