Solving this task is actually partially based on the previous tasks. In order to print the days of the month as indicated in the problem, you should know:
- What weekday is the first day of the month. This can be determined using the week_day() function created for a previous problem.
- The number of days in the month. This can be determined using the date::year_month_day_last structure and retrieving the value of day().
With this information determined first, you should:
- Print empty values for the first week before the first weekday
- Print the day number with the proper formatting from 1 to the last day of the month
- Break on a new line after every seven days (counting from day 1 of the first week, even though that could ...