Write a program that will be able to print the calendar for any month requested by the user. For example, in the following example, the user requests the month for the date 5/20/2016:

Enter a date (m d yyyy): 5 20 2016
May 2016
SUN MON TUE WED THU FRI SAT
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 [20] 21
22 23 24 25 26 27 28
29 30 31

Note that the date given by the user is highlighted using square brackets. The program should be able to take any valid date. If the user gives an invalid date (such as 20 20 2016), the user should be given a user-friendly error message.

Notes:

1. To map a number to a string (such as 5 to "MAY" in the above example), you can use an array that stores the names of the months and then use the number given by the user as a subscript into the array.

2. To find the day that the month begins on, you can use the dayOfWeek() function given in the file calendar.cpp.

3. The number of days in any given month is always the same (except for Feb which can be 28 or 29). Thus, this can also be stored in an array in the program and the month given by the user can be used a subscript into this array. The exact number of days in each month is given at this link: http://www.timeanddate.com/calendar/months/

4. calendar.cpp also includes the function used to determine leap years.

5. The calendar should be properly aligned as shown in the example above.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.