Question: *12.2 (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between 1 and 12 and

*12.2 (ArrayIndexOutOfBoundsException) Using the two arrays shown below, write a program that prompts the user to enter an integer between 1 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 Array IndexOutOf Bounds Exception. String[] months = {"January", "February", "March". "April". "May", "June", "July". "August". "September", "October". "November", "December"); int[] dom (31, 28. 31. 30, 31, 30. 31. 31. 30, 31, 30, 31);
Step by Step Solution
There are 3 Steps involved in it
To solve this problem we need to create a Java program that uses the given arrays to prompt the user for a number and then display the corresponding m... View full answer
Get step-by-step solutions from verified subject matter experts
