*12.2 (Array IndexOutofBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between I and 12 and then displays the months and its number of days corresponding to the integer entered. Your program should display "wrong number" if the user enters a wrong number by catching ArrayIndexOutofBoundsException. String() months ("January", "February". "March", "April". "May", "June", "July". "August", "September". "October". "November". "December"): int [) don - (31, 28, 31, 30, 31, 30. 31, 31, 30, 31. 30, 31):

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question
Solve
JJava
*12.2 (ArrayIndexOutofBoundsException) Using the two arrays shown below,
write a program that prompts the user to enter an integer between I and 12 and
then displays the months and its number of days corresponding to the integer
entered. Your program should display "wrong number" if the user enters a
wrong number by catching ArrayIndexOutofBoundsException.
String[) months = ("January",. "February", "March", "April",
"Hay", "June". "July", "August", "September", "October",
"November", "December"}:
int [] dom = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31):
Transcribed Image Text:Solve JJava *12.2 (ArrayIndexOutofBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between I and 12 and then displays the months and its number of days corresponding to the integer entered. Your program should display "wrong number" if the user enters a wrong number by catching ArrayIndexOutofBoundsException. String[) months = ("January",. "February", "March", "April", "Hay", "June". "July", "August", "September", "October", "November", "December"}: int [] dom = (31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31):
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT