Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Trying to write these parts into one coding program. Using java for this, on Notepad ++ import java.util.Scanner; public class myArrayLab { public static void

Trying to write these parts into one coding program. Using java for this, on Notepad ++

import java.util.Scanner;

public class myArrayLab {

public static void main(String[] args) {

Part 1) Write a main method that reads 10 integer values from a file and stores them in an array calledages. 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).

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.

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.

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Compare the current team to the ideal team.

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago

Question

How do members envision the ideal team?

Answered: 1 week ago