Write a main method that reads 10 integer values from a


Write a main method that reads 10 integer values from a file and stores them in an array called ages.

Write a new method called printArray that receives the ages array and prints the content of the array separated by commas (No comma at the beginning or end of the line).

File Sample: 5 7 18 30 5 78 8 22 6 90 Output Sample) Ages: 5,7,18,30,5,78,8,22,6,90 Part 2)

Write a method called Sort1 that will use the array ages.

This method will arrange all the ages in the array from youngest to oldest and return a new array called sortedAges.

Print new arranged values by calling the method printArray with parameter sortedArray. Output Sample)

Ages: 5,5,6,7,8,18,22,30, 78, 90 Part 3) In the main method, create a two dimensional array of length 5 rows by 5 columns with the values shown below. Write a method called print printArray2 to print the content of the array in matrix form. Output Sample) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Part 4).

Write a method called print printArray3 to print the content of the elements of the diagonal elements in the matrix above. This print method should work for any array of size n by n. Output Sample) 1 7 13 19 20 5 9 13 17 21

(Java Language)

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Write a main method that reads 10 integer values from a
Reference No:- TGS02884993

Expected delivery within 24 Hours