Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1: Make a square, 2 dimensional array of random size (limit the length to 1 through 10). Example array sizes would be 4x4, 5x5,

Question 1:Make a square, 2 dimensional array of random size (limit the length to 1 through 10). Example array sizes would be 4x4, 5x5, etc..

Hint: The square can use the same random value for x and y. Don't allow 0 size arrays.

Question 2: Fill the array with random integers from 1 to the size(length) limit of the arrays. An example 5x5 array might look like this:

15153

15545

13355

11314

24153

Hint: You can use for loops to go from row(0) col(0) to row(x)col(x).

Question 3:Print the phrase "_x_ array:" to the console, where_x_is replaced with the dimensions of the array. For example, you could print5x5 array:

On the next line, print the array in the square format (rows and columns as in the previous examples).

Hint: On screen it will look like a rectangle, but as long as the number of rows and columns are the same we will consider it a square.

Question 4:Find the row with the largest sum of values, and print the following line to console"The record at row x has the highest score of y"wherexis the row number andyis the sum of that row. An example line might read "The record at row 2 has the highest score of 20

Hint1: Do not print the row index. Rather print the row number, with 1 being the lowest possible row number.

Question 5:Provide one example of what you might store in a 2-dimensional array. If your example array was 3-dimensions, what additional information could you store?

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