Question: Hello I'm having difficulty with a java assignment. The book for the class is Introduction to Java Programming, Comprehensive Version Y. Daniel Liang & Prentice

Hello I'm having difficulty with a java assignment. The book for the class is Introduction to Java Programming, Comprehensive Version Y. Daniel Liang & Prentice Hall 11th Edition / 2018.

We are currently working in Chapter 8, Multidimensional Arrays

Write a program that accepts an n x n matrix. The program should also:

1. Total and display the sum of each row and each column

2. Find the product of each row and column

3. Find the highest and lowest value within the array

Constraints

The number of rows and columns should be the same

Use nested for loops and methods

Requirements

Build your matrix based upon user input (e.g., ask how many rows and columns - they must be the same)

Use a method to display the matrix (use tabs between each element)

Create methods to display the following:

o Method 1: The sum of each row

o Method 2: The sum of each column

o Method 3: The product of each row

o Method 4: The product of each column

o Method5:Thehighestvalueinthematrix

o Method6:Thelowestvalueinthematrix

Loop the program to run it until the user wishes to exit

In the example below, the numbers ARE NOT hard coded. Your program should ask the user for input

This program should utilize code learned from Week 1 through Week 8

Hints

Make sure you use Java coding conventions

Expected Output

The following pages show a sample run with two iterations. User input is in BOLD.

Deliverables

Please zip your program and submit the zip file by the due date listed in the requirements.

Welcome! This program that accepts an n x n matrix, totals the rows and columns & finds the product of each row and column.

Enter number of rows & columns (they will be the same): 2

Enter a value for Row 1, Column 1: 3

Enter a value for Row 1, Column 2: 8

Enter a value for Row 2, Column 1: 7

Enter a value for Row 2, Column 2: 9

The Matrix****************************************

You Entered the Following Matrix: 3, 8,

7, 9,

Row Totals****************************************

The sum of row 1 is: 11

The sum of row 2 is: 16

Column Totals*************************************

The sum of column 1 is: 10

The sum of column 2 is: 17

Row Products*************************************

The product of row 1 is: 24

The product of row 2 is: 63

Column Products*************************************

The product of column 1 is: 21

The product of column 2 is: 72

The greatest value in this matrix is: 9

The lowest value in this matrix is: 3

Enter another matrix? (Y or N) y

Enter number of rows & columns (they will be the same): 3

Enter a value for Row 1, Column 1: 7

Enter a value for Row 1, Column 2: 99

Enter a value for Row 1, Column 3: 2

Enter a value for Row 2, Column 1: 4

Enter a value for Row 2, Column 2: 55

Enter a value for Row 2, Column 3: 6

Enter a value for Row 3, Column 1: 2

Enter a value for Row 3, Column 2: 33

Enter a value for Row 3, Column 3: 7

The Matrix****************************************

You Entered the Following Matrix: 7, 99, 2,

4, 55, 6,

2, 33, 7,

Row Totals****************************************

The sum of row 1 is: 108

The sum of row 2 is: 65

The sum of row 3 is: 42

Column Totals*************************************

The sum of column 1 is: 13

The sum of column 2 is: 187

The sum of column 3 is: 15

Row Products*************************************

The product of row 1 is: 1386

The product of row 2 is: 1320

The product of row 3 is: 462

Column Products*************************************

The product of column 1 is: 56

The product of column 2 is: 179685

The product of column 3 is: 84

The greatest value in this matrix is: 99

The lowest value in this matrix is: 2

Enter another matrix? (Y or N) n

Thank you for using the program!

Goodbye!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!