Ask the user to enter the month of the year (number 1 through 12): “Enter the month of the year - number 1 to 12”b. Get the month using a Scannerc. checks for invalid input (i.e. numbers that are not 1 – 12) and terminates the programusing System.exit(1)if input is invalidd. Prints the name of the month: “The month is XXXXX”Now, this time, write a class, NumberToMonthUsingSwitch, that does the same but uses the switch statement.Tips Use the switch statement along with case and break Use the System.exit(1) in the default to terminate the programSubmission Copy and paste your code Screen shot the console with user input of three example months (one invalid input, two anymonth)Sample RunEnter the month of the year - number 1 to 1277Invalid InputEnter the month of the year - number 1 to 122The month is FebruaryEnter the month of the year - number 1 to 1210The month is October
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here