Question: D - Months This class will be coded by you from scratch. Write a program Months that prompts the user to enter a month (1
D - Months
This class will be coded by you from scratch.
-
Write a program Months that prompts the user to enter a month (1 = January, 2 = February, and so on) and then prints the number of days of the month.
-
For example, February would result in 28 days.
Months should print the output shown here (numbers in red are entered by the user):
Enter the corresponding numerical value of a month: 2 February has 28 days.
If the user types an invalid entry, Months should print the following:
Enter the corresponding numerical value of a month: 42 Invalid entry. There are only 12 months.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
