Here's what I need to do:
If the start day is not in the range 0 to 6 inclusive or if the number of days is not in the range 1 to 31 inclusive, the program should display a helpful error message instead of displaying a calendar. If the parameters are OK, the program should display the numbers for the calendar as they would appear on a typical calendar.
However, when I test this function, the calendar is still displaying even when the parameters are invalid.
You are checking if the parameters AFTER you print the calendar. Move the last if statement just past int day, and add a return after the cout << "Please try again." << endl;, otherwise the months will still print since you haven't told the program not to.