Write a java program named Matrix.java including the following methods: 1. [7 marks] Write a method...
Fantastic news! We've located the answer you've been seeking!
Question:
Transcribed Image Text:
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 marksbonus 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
Expert Answer:
Answer rating: 100% (QA)
import java util Random import java text DecimalFormat import java util Scanner public class Matrix private double matrix private int View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions

You work for an organization that is concerned about automotive technologies. Your supervisor has asked that you examine and report significant conclusions for the following data set: that is below,...

Colors and More is considering replacing the equipment it uses to produce crayons. The equipment would cost $1.37 million, have a 12year life, and lower manufacturing costs by an estimated $304,000...

This chapter deals with control systems associated with business processes, such as operating processes. Provide a definition and some examples of operating processes. In what other processes would...

A postal employee drives a delivery truck along the route shown in Fig. 1.33. Determine the magnitude and direction of the resultant displacement by drawing a scale diagram. (See also Exercise 1.38...

(a) Show the details of a check of the constraints given on transition conditions as applied to Figure 630. (b) Implement the state machine diagram for the Game of PIG in Figure 630 using a onehot...

Patrick Company wants to raise $50 million cash but for various reasons does not want to do so in a way that results in a newly recorded liability. The firm is sufficiently solvent and profitable, so...

You have to read "Letter from Birmingham City Jail" by Martin Luther King, Jr. Read the study questions to help you understand King's essay, but you are not required to turn in the answers. In your...

The television show NBC Sunday Night Football broadcast a game between the Colts and Patriots and received a share of 22, meaning that among the TV sets in use, 22% were tuned to that game (based on...

In your capacity as a certified Islamic accountant who has been working for several years at HSBC Bank and presented to you the details of the two partnership financing contracts, and based on the...

Who is responsible for workplace safety? Do you think that employees with MRSA/Covid 19 or another contagious disease should be treated differently at the workplace? why or why not? Please support...

Danny Wong, a claims supervisor at an insurance company, recently took a leadership development course sponsored by his company. The major thrust of the course was to teach supervisors how to...

Write a function countChar(text) that given a string text, the function returns a dictionary of characters and their counts used in text. You need to count only characters 'a' to 'z', all upper...

Let the function t(n) be defined recursively by: t(1) = 1 and t(n) = 3t(n/2) +n + 1 for n a power of two greater than 1. How many children will each internal node of the recursion tree have? O (a) 1...

Assume you have a hash table of size 7. What is the final status of the hash table after inserting the keys 10, 36, 17, 19 and 24 (in that order) assuming collisions are handled by open addressing...

As at 31 March 2018, DuckTales Ltd has another financial instrument which is shares in another company. These shares were purchased for the purposes of making a gain on the investment. Explain to...

g(x) = x 5 5x 6 a. Show that g(x) = 0 has a root, , between x = 1 and x = 2. b. Show that the equation g(x) = 0 can be written as x = (px + q) 1/r , where p, q and r are integers to be found. The...

The following additional information is available for the Dr. Ivan and Irene Incisor family. Ivan and Irene have the following investment income, in addition to that reported in Chapter 1: Dividends...

Leslie is a single taxpayer who is under age 65 and in good health. For 2012, she has a salary of $23,000 and itemized deductions of $1,000. Leslie is entitled to one exemption on her tax return. a....

How much of each of the following prizes or awards is taxable? a. Cheline received a $50,000 gift bag at the Oscars in 2012. b. Jon received a gold watch worth $350 for 25 years of service to his...

List two ways in which a gamma ray differs from an alpha or beta particle.

Write equations for the following nuclear reactions. (a) Alpha decay by 188 Bi (b) Beta emission by 87 Rb (c) Positron emission by 40 K (d) Electron capture by 138 La

Write equations for the following nuclear reactions. (a) 94 Tc undergoes electron capture. (b) 89 Nb ejects a positron. (c) 217 Fr emits an alpha particle. (d) 220 Ra is formed by alpha emission.
Question Categories