Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

simple code please thanks! Design an application in which you declare an array o

ID: 3645892 • Letter: S

Question

simple code please thanks!

Design an application in which you declare an array of five numbers and store five values in the array. Write a try block in which you loop to display each successive element of the array, increasing a subscript by one on each pass through the loop. Assume you are working with a language that automatically creates an ArrayIndexOutOfBoundsException when a subscript is not correct for an array. Create a catch block that catches the exception if it is generated and displays the message,

Explanation / Answer

int array[5]={1,2,3,4,5}; try{ for(i=0;i