Question: java G torre New Tab Intro Wet Log o Loo Sign Safe G gem Sate Page wpid-1197731-dt-content-rid-29185991 1/courses/20SP_CPS_1231 01/lab3-2%281%29.pdf 2/2 CPS 1231 Chapter 3 lab

 java G torre New Tab Intro Wet Log o Loo Sign
java

G torre New Tab Intro Wet Log o Loo Sign Safe G gem Sate Page wpid-1197731-dt-content-rid-29185991 1/courses/20SP_CPS_1231 01/lab3-2%281%29.pdf 2/2 CPS 1231 Chapter 3 lab 2 2. (10 points) Write a class, NumberToMonth, which does the following: a. 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 Scanner c. checks for invalid input (ie numbers that are not l-12) and terminates the program using System.exit(1) if input is invalid d. Prints the name of the month: "The month is XXXXX" Tips Use a multi-way if-else statement Submission Copy and paste your code Screen shot the console with user input of three example months (one invalid input, two any month) Sample Run Enter the month of the year (number 1 to 12) Invalid Input Enter the month of the year (number 1 to 12) The month is June Enter the month of the year (number 1 to 12) The month is December

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!