Example 4: contract for Date ADT (1)
Assumed application requirements:
- *** The values must be all past, present, and future dates.
- *** It must be possible to construct a date from year number y, month number m, and day-in-month number d.
- It must be possible to compare dates.
- It must be possible to render a date in ISO format “y-m-d”.
- It must be possible to advance a date by n days.