C++ Using the classes extDateType from the Chapter 11 class projects and dayType
ID: 3885033 • Letter: C
Question
C++
Using the classes extDateType from the Chapter 11 class projects and dayType from the Chapter 10 class projects, design the class calendarType so that, given the month and the year, you can print the calendar for that month. To print a monthly calendar, you must know the first day of the month and the number of days in that month. Your calendarType class will have two private instance variables: firstDay of type dayType to hold the first day of the month and date of type extDateType to hold the month and year for the calendar. The calendarType object must use as much of the functionality of its object variables as possible. In fact, the only functionality required of calendarType is to determine the first day of the month and to actually print the calendar. Here is the UML diagram for this class:
Note that the return type of the member function firstDayOfMonth is dayType. This return value should be stored in the firstDay variable.
Design the class calendarType so that the program can print a calendar for any month starting January 1, 1500. Note that the day for January 1 of the year 1500 is a Monday. To calculate the first day of a month, you can add the appropriate days to Monday of January 1, 1500.
Write a test driver which uses a loop to produce output similar to the following:
Turn in all your header files, all your implementation files, and your test program. Also turn in one or more screen shots showing the results of your testing.
Once this project is completed you will demonstrate that you are able to:
Apply the functionality of aggregate object members to minimize coding effort in a project
Utilize a member function that returns an objec
Explanation / Answer
$calendar->onTitleRender(function($currentMonth, $prevMonth, $nextMonth){ return '' . date('F - Y', $currentMonth) . '' . ''; }); $calendar->onDayRender(function($day, $month, $year){ return '' . $day . ''; });Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.