Question: Write a partial C++ class definition that contains the public interface of the Date class described in Exercise R9.2. Supply member functions for setting the

Write a partial C++ class definition that contains the public interface of the Date class described in Exercise R9.2. Supply member functions for setting the date to a particular year, month, and day, for advancing the date by a given number of days, and for finding the number of days between this date and another. Pay atten tion to const.

Exercise R9.2

Consider a Date class that stores a calendar date such as November 20, 2011. Consider two possible implementations of this class: by storing the day, month, and year, and by storing the number of days since January 1, 1900. Why might an implementor prefer the second version? How does the choice affect the user of the class?

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 Programming Questions!