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.