Question: Design a class to print a monthly calendar given a month and a year. Use a dayType object to hold the first day of the
Design a class to print a monthly calendar given a month and a year. Use a dayType object to hold the first day of the month, use an extendedDateType object with the day set to 1 to store the month and year. Note that these objects are attributes of a calendar object and are hidden from a user of the calendar class. Use the following CRC specification to develop this class:
| Class: calendarType | |
| Super Classes: | |
| Sub Classes: | |
| Description: Prints a calendar for a specified month and year | |
| Responsibilities: | Collaborations: |
| Initialize and set the month and year | extendedDateType |
| Initialize and set the first day of the month (For example, April 1, 2016 starts on a Friday). Assume that you can print a calendar for any month starting January 1, 1500 and note that January 1, 1500 is a Monday). | dayType |
| Print the calendar. Note that extendedDateType can provide the label for the calendar and the number of days in the month). Also dayType can provide the first day of the week for the current month and year. | extendedDateType, dayType |
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
