In the main method have the user input the size of an array


For this program, use the program,ECLIPSE-NEON."
Programming Assignment #1

The assignment is to create a Java program that manipulates an array.

Step 1:

In the main method, have the user input the size of an array. Create an integer array of that size. Then call the methods outlined in the following steps.

Step 2:

Create a method with signature: public static void initArray( int [] values ) that initializes the integer array with random values between 1 and 10.

Step 3:

Create a method with signature: public static void printArray( int [] values ) that prints the array.

Step 4:

Create a method with signature: public static void squareArray( int [] values ) that prints the array with all values squared, but does NOT change the array.

Step 5:

Create a method with signature: public static void reverseArray( int [] values ) reverses the values of the array. The values of the array should be changed...

Step 6:

Create a method with signature: public static void transposeArray( int [] values ) switches each pair of the array. The values of the array should be changed.

Note: Print the array after each step... (See sample I/O)

Sample INPUT/OUTPUT:

Enter size of array: 6
Values in array are:
1 2 3 4 5 6
Values in array when squared are:
1 4 9 16 25 36
Values in array when reversed are:
6 5 4 3 2 1
Values in array when transposed are:
5 6 3 4 1 2

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: In the main method have the user input the size of an array
Reference No:- TGS02900845

Expected delivery within 24 Hours