Question: In the ** `Main.java `** file, you are going to demonstrate basic Java array knowledge. public class Main { public static void main(String[] args) {
In the **`Main.java`** file, you are going to demonstrate basic Java array knowledge.
public class Main {
public static void main(String[] args) {
int[] ia;
// fill the array with random numbers
// display array in forward order
for ( x = 0; x < ia.length; x++)
System.out.print(ia[x] + " ");
// now print numbers in reverse order
}
}
** This program **DOES NOT COMPILE**. Part of the purpose of this assessment is to have you fix the syntax and semantic issues while addressing the flow of the program.
An unallocated array variable has been declared in the `main()` method. Assign 10 random numbers in the range 1 to 100 to the array.
Write additional Java code to display the values forward and backward on two separate lines. Your output will resemble:
`34 56 78 29 30 10 1 97 16 82`
`82 16 97 1 10 30 29 78 56 34`
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
