Question: CS136: Computer Science II-Spring 2019 [10 points] Problem #3 Write a Java class (ArrayPrinter.java) with one main method that initializes an array (and not an
![CS136: Computer Science II-Spring 2019 [10 points] Problem #3 Write a](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66da9dcc6bfed_27566da9dcbcf6c6.jpg)
CS136: Computer Science II-Spring 2019 [10 points] Problem #3 Write a Java class (ArrayPrinter.java) with one main method that initializes an array (and not an ArrayList) with ten random integers (between 2 and 20 inclusive) and then prints six lines of output, containing The array contents. The array elements at even indexes. All even elements. All elements in reverse order The first element in the array The last element in the array Examples of program output: The whole array: 10 23 17 243 1055 Elements at even indexes: 10 3 235 Even elements: 10 22 4 10 The whole array in reverse order: 5 5 10 3 42 17 32 10 The first element: 10 The last element: 5 The whole array: 9 12 15 9 4 15 18 11817 Elements at even indexes: 9 15 4 18 8 Even elements: 12 4 18 8 The whole array in reverse order: 17 8 11 18 15 4915 129 The first element: 9 The last element: 17 Make sure that your code compiles and runs without errors when the following commands are used For compilation javac ArrayPrinter.java For execution java ArrayPrinter
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
