Write a java program to perform matrix multiplication

Assignment Help JAVA Programming
Reference no: EM1381461

In this project you need to write a java program called "MM.java" to perform matrix multiplication. Your code will read in two input files named"matrixA.txt" and "matrixB.txt", and then create a file named"matrixAnswer.txt" and output the result to the file.

Input and Output:

Your code will need to be able to read in these files, place the contents of each file into separate two-dimensional arrays and then perform the needed multiplication and place the output of the multiplication into a third two-dimensional array then write the array out into a file.

Please check the sample input files"matrixA.txt" and "matrixB.txt".

1. matrixA.txt is the file that contains the first matrix A. It has x rows and y columns. The numbers in each row are separated by one blank space.

2. matrixB.txt is the file that contains the second matrix B. It has y rows and z columns. The numbers in each row are separated by one blank space.

Please check the sample output file "matrixAnswer.txt".

1. matrixAnswer.txt is the matrix by multiplying matrix A and matrix B. Your program should create the file and output the result to the file. It has x rows and z columns. The numbers in each row are separated by one blank space.

Sample input files are provided but you can't presume the size of the input matrices. You will also need to check if it is legal to multiply both of these matrices together. If it is not legal, you need to inform the user that you are unable to perform the multiplication. As long as the two input matrices have the legal sizes to do multiplication then your program should generate the right product of the two matrices.

Submission:

You need to submit a java file "MM.java" to blackboard. The program will be tested using command line. The files "MM.java", "matrixA.txt", and "matrixB.txt" will be placed inthe same directory. Your program needs to output the file "matrixAnswer.txt" to the same directory. So be certain that your program compiles and runs correctly before you submit it!

Reference no: EM1381461

Questions Cloud

Identify, discuss, and be specific on five differential cost : Identify, discuss, and be specific on five differential costs that might exist between the two options
Sociological approaches to gender and media : While the media may try to communicate a message of non-bias when it comes to gender in advertising, there is still a significant amount of information that communicates the exact opposite.
Do you agree with the jury that she was guilty be-yond : Do you agree with the jury that she was guilty be-yond reasonable doubt of the conspiracy and obstruction of justice charges? was her punishment, including both imprison-ment and fines, appropriate?
What is sociological imagination : How could it be applied to, for example, watching people running in a marathon, where our children attend school, or where we shop for groceries?
Write a java program to perform matrix multiplication : In this project you need to write a java program called to perform matrix multiplication and
Negative consequences of bureaucracy : Critically discuss the negative consequences of bureaucracy as viewed from both the individual and organizational perspectives. Please include instnaces to support your answer.
Raising downton wombats : Assume that you are increasing Downton wombats, carefully because they bite when teased. You notice that some of your wombats have white spots, whereas others have solid coats.
Sketch hierarchy chart and draw logic for program : Sketch the hierarchy chart and draw the logic for program which comprises housekeeping, detail loop and end-of-job modules and which computes service charge customers.
Important genetic question : In wild pigs, the allele for black fur is dominant over the allele for brown fur. A black wild pig is crossed with a brown wild pig, producing five F1 black wild pigs and six F1 brown wild pigs.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Using a linked implementation of graph write a method

Write a method that takes two nodes as input and returns true if joining an edge between these two nodes, forms a duplicate path to one of the input nodes within the graph.

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Write a java program using array to auto-grade exams

Write a JAVA program using 2D Array to auto-grade exams. For a class of N students, your program should read letter answers (A, B, C, D) for each student.

  Program to find maximum-minimum of sequence of values

Common task which should be done in loop is to find maximum and minimum of sequence of values. File Temps.java contains program which reads in sequence of hourly temperature readings over 24- hour period.

  Create java applet to represent grade of gas

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Compute area and perimeter of a polygon

Create a project that would let a user compute area and perimeter of a polygon

  Determine if strings are equal

Complete the recursive method match in the code below which will determine whether or not two strings match.

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Design and implement a small and simple email server

Design and implement a small and simple email server using the concept of web based information system (WBIS).

  Write a java program to implement the finite field

Write a program called "GF2.java" to implement the finite field GF(p n ) where p is a prime number and n is a positive integer.  You also need to write four methods to realize "+", "-", "´", and "/".

  Rock-paper-scissors :- java problem

Design decision marks are based on how you implemented our programs/classes.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd