Write a java program named Matrix.java including the following methods: 1. [7 marks] Write a method...
Fantastic news! We've Found the answer you've been seeking!
Question:
![](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2023/09/65014ada045a0_1694583510143.jpg)
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 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 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
Expert Answer:
Answer rating: 100% (QA)
import javautilRandom import javatextDecimalFormat import javautilScanner public class Matrix private double matrix private int rows private int colum... 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
-
Cash Investment in equity securities Accounts receivable Inventory Prepaid insurance (for the next 9 months) Land Buildings Accumulated depreciation-buildings Equipment Accumulated...
-
(10) Let A be a linear transformation of Rn with the standard inner product xiyi. Prove that Ker (AA) Ker(A). (Hint: recall first what does it mean that = x Ker(B) for a linear operator B and then...
-
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,...
-
Use Lagrange multipliers to find the maximum area of a rectangle inscribed in the ellipse (Figure 15): (-x,y) (x, y) 2 a2 b2 + J2 = 1 (x, y) (x, y) X
-
What is the purpose of conformed dimensions for different star schemas within the same data warehousing environment?
-
A rumor spreads through the offices of a company with 200 employees, starting in a meeting with 10 people. After 3 days, 35 people have heard the rumor. (a) Write an equation for the number of people...
-
9. If a partner sells his or her partnership interest directly to a third party, the partnership may or may not be dissolved. Under what conditions is the partnership dissolved?
-
At one time, Boeing closed a giant deal to acquire another manufacturer, McDonnell Douglas. Boeing paid for the acquisition by issuing shares of its own stock to the stockholders of McDonnell...
-
If a business is considering the option of processing its product further, it ignores the ________. A. additional costs necessary to process further B. cost that is required to produce the basic...
-
On January 4, 2015, an FI has the following balance sheet (rates = 8 percent) DGAP = [8 (396/450)4] = 4.48 years > 0 The FI manager thinks rates will increase by 0.55 percent in the next three...
-
A Cold Inc. is a frozen-food distributor with 10 warehouses across the country. Ivan Tory, one of the warehouse managers, wants to make sure that the inventory policies used by the warehouse are...
-
An important first step of exploratory data analysis is always to visualize the data. Construct a scatterplot of each time series (i.e., two different plots). If you need pointers on how to make a...
-
Cleanie Wombat Cleanie Wombat is a small Australian company that makes cleaning products. The chemical formulas used for its products were developed through R&D conducted by the company's small R&D...
-
As a manager at Yummy Melts, Martin is responsible for the firm's Just Right brand of ice cream. He recently approved a proposal to test market new ice cream flavors. He is also considering the...
-
Cogenesis Corporation is replacing their current steam plant with a 6-megawatt cogeneration plant that will produce both steam and electric power for their operations. What is the impact of a 5% and...
-
Suppose ABC firm is considering an investment that would extend the life of one of its facilities for 5 years. The project would require upfront costs of $9.97M plus $28.94M investment in equipment....
-
Compare and contrast measurement using historical cost and fair value. You should address the following issues for each method. (i) Outline whether it involves fundamental or derived measurement. (4...
-
Draw a Feynman diagram for the reaction n + v p + .
-
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...
-
CI9.3. Describe off-balance-sheet financing.
-
C19.1. Explain what a default premium is.
-
CJ9.2. Whatis the objective in reformulating financial statements for credit analysis? How does the reformulation for credit analysis differ from that for equity analysis?
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App