Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve using java: In mathematics, matrices are arrays of elements that are used to interpret the theoretical results of linear algebra. The frequently used

Please solve using java:

image text in transcribed

image text in transcribed

In mathematics, matrices are arrays of elements that are used to interpret the theoretical results of linear algebra. The frequently used matrices are 2-dimensional matrices that can be visually associated with a table with rows and columns. In this system, the size of the matrix is denoted by the notation mxnn where m is the number of rows and n is the number of columns. [321540]12053846[1.60.21.0][2003.5]22[53]2040330320001 In this homework, we will implement in Java a rather irregular 2D matrix, whose last elements of the last row may not exist (i.e. the last elements may be missing). Here are two examples. [32154].20400300 Here are the specifications of our implementation: - The elements are positive real numbers of type Double - The irregular matrix must be represented by a 1-dimensional array i.e. Double[] array. - To save memory, your array should just contain the existing elements. - The number of columns as well as the total number of elements are defined by the user - The number of lines will be sent to the command line and will be contained in args[0] - The number of columns will be sent to the command line and will be contained in args[1] - The elements will be entered one by one by the user until the user enters the number 0 . For a matter of simplicity. - Double elements will be treated with a precision of 1 digit after the decimal point i.e. DecimalFermat("\#.0") - The class's toString() method must return a visual representation of the array where empty cells should not be displayed. - Hint: You can use the StringBuffer class to contain and manipulate character strings of dynamic way. You are asked to complete: The IrregularMatrix class by adding additional attributes (if necessary), and the required Class or Instance methods as well as the Constructor. The IrregularMatrix Test class which contains the main(String[] args) function and which will build and display the content of our matrix. Running the program should "exactly" look like the model below. The result shows the execution of "java IrregularMatrixTest 3 4". (Other examples of executions will be attached to the assignment). 42 568 45.5 34567.5 22.3 0.3 45 89.9 7 0 Matrice/Affichage Nombre de 1ignes=3 Ligne \#0/ Min=42.0, Max=34567.5 Ligne \#1/ Min=0.3, Max=89.9 Ligne \#2/ Min=7.0, Max=7.0 Matrice/ Min=0.3, Max=34567.5 Matrice/ Total=35387.5000000001 You will notice the aesthetic aspect of the table where the cells have the same size, and the horizontal and vertical lines appropriately delineate the ends of the array. Of course, your program should work if the array contains just 1 single item, where it is displayed only in a single row or in a single column

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

Students also viewed these Databases questions