Question: Write a java program named Matrix.java including the following methods: 1. [7 marks] Write a method named genMatrix that given, m, the number of

Write a java program named Matrix.java including the following methods: 1. [7

Write a java program named Matrix.java including the following methods: 1. [7 marks] Write a method named genMatrix that given, m, the number of rows and columns initializes and returns a matrix with random positive double values less than 100. 2. [7 marks] Write a method named printMatrix that given a matrix of m rows and m columns of doubles, prints it in a tabular format with 2 digits after decimal point. 3. [7 marks] Write a method named isSymmetric that given a matrix checks whether it is symmetric. A matrix, M, is symmetric if for every index of i and j the M[i][j] is equal to M[j][U]. 4. [7 marks] Write a method named Multiply that given a double coefficient c and a matrices of m rows and m columns of doubles, calculates and returns cxM1. The original matrix should not be changed. cx M1 = M where M[i][j] =cx M1[0][], For more information, check this. 5. [4 marks-bonus marks - optional] Write a method named Square that given a matrices of n rows and n columns of doubles, calculates, and returns the square of the given matrix. The original matrix should not be changed. M1 x M2 = M where M[i][i] = 1 M1[i][k] x M2[k]], For more info, check this. 6. [7 marks] Write a main method that shows a menu like the following for choosing an operation and shows the result accordingly. M is a matrix with random positive double values less than 100. Choose one of the following options to resume the program: 1: Create M 2: Display M 3: Square M 4 Multiply M with a coefficient Check whether M is symmetric 5 6 Quit the program

Step by Step Solution

3.34 Rating (163 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javautilRandom import javatextDecimalFormat import javautilScanner public class Matrix private double matrix private int rows private int colum... View full answer

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 Programming Questions!