Question: Design a switch statement that will take the monthNumber (which is an integer, and having values between 1 to 12) and is an user-input, and

  1. Design a switch statement that will take the monthNumber (which is an integer, and having values between 1 to 12) and is an user-input, and it will store the corresponding month name in the string variable month, and also, noOfDays in the month based on the following table:

monthNumber month noOfDays

1 January 31

2 February 28

3 March 31

4 April 30

5 May 31

6 June 30

7 July 31

8 August 31

9 September 30

10 October 31

11 November 30

12 December 31

Finally, display the month name and no of days, based on user input for monthNumber

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 Databases Questions!