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:
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
-
Replace the wrench shown with an equivalent system consisting of two forces perpendicular to the y axis and applied respectively at A and B. A M R
-
Sketch how the Mach number and velocity vary through a de Laval nozzle from the entrance to the exit. How is the velocity variation different from a venturi configuration?
-
Give examples of information systems and automated information systems. How do they differ from each other?
-
Your firm has been engaged to do the current years audit of Dawood Ltd., a medium sized business involved in manufacturing television screens and monitors. Dawood is privately owned and its two...
-
Described below are certain transactions of Carla Corporation. The company uses the periodic inventory system. 1. 2. 3. 4. On February 2, the corporation purchased goods from Martin Company for...
-
Under what circumstances should a systems analyst recommend an agile methodology over structured development or object-oriented analysis?
-
How does DNA replication ensure accurate copying of genetic information?
-
For the function f(x) = 3 calculate the following function value f(2) = f(3) =
-
Morgan-Hunt Agency, a financial investment company, pays $300 to each of its salespersons as a year-end bonus, regardless of productivity. This is an example of a(n) Discuss in details.
-
Find the first, second, and third derivative of the following function. h(x) = (82 4)* a. h'(x)= b. h"(x)= c. h(x)=
-
On 1 October 2022, Drew and Kramer commenced a partnership. As Drew had contributed most of the working capital, the partnership agreement provided that Drew would receive 60% of the net partnership...
-
Definitions Terms 1. Helps determine financing needs. 2. A comprehensive plan that consists of several budgets that are linked. 3. Employees affected by a budget help in preparing it. 4. Management's...
-
Kevin Ali has decided to incorporate his retailing business. He plans to transfer the assets of the business to KA Inc., a corporation that is wholly owned by him. Kevin will file an election under...
-
Software Solution is family-owned business that has been in operation for more than 15 year. The board of directors is comprised of mainly family members, plus a few professionals such as an...
-
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...
-
The trial balance columns of the worksheet for Barbosa Apparel at June 30, 2025, are as follows. Other data: Operating expenses incurred on account, but not yet recorded, total R$1,640. Instructions...
-
Presented below is information for Bach Chocolatiers for the month of March 2025. Instructions a. Prepare an income statement. b. Prepare a comprehensive income statement. c. Compute the gross profit...
-
In 2025, Endeaver Cameras had net sales of 860,000 and cost of goods sold of 533,200. Operating expenses were 221,000, and interest expense was 7,000. Instructions a. Compute Endeavers gross profit....
Study smarter with the SolutionInn App