Question: Question: Write A Switch Statement To Convert An Int Month To The Month Name. If The Month Is Not A Valid Number Give A Statement

Question:Write A Switch Statement To Convert An Int Month To The Month Name. If The Month Is Not A Valid Number Give A Statement

8. Write a switch statement to convert an int month to the month name. If the month is not a valid number give a statement that says something like not a month. You should use Scanner for this question.

a. Now use a switch statement to display how many days are in a given month. The month is represented in int form. January, March, May, July, August, October, and December have 31 days April, June, September, and November have 30 days. February has 28 or 29.

b. Now combine the two to take an int month and convert it to words and tell how many days it has.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!