Write a program which adds two matrices

Assignment Help JAVA Programming
Reference no: EM13713053

Programming Problem:

NOTE: You can't use global variables! You can use global constants.

Program- Write a program which adds two matrices together and displays the sum.

- Your program should declare three 3 x 3 arrays. Two arrays will contain user input, and the third array will be used to contain the sum of the two arrays.

- You must write a function which gets input from the user and loads an array a row at a time. Your main routine will call this function twice.

- You must have another function which takes the two input arrays and adds the corresponding elements, placing the result into the equivalent position in the result matrix.

Theoretically, matrix addition is as given:

                        result[x][y] = input1[x][y] + input2[x][y];

Lastly, your program should display both input matrices and the result matrix in a way that the sum of the two matrices can be simply verified by looking at the output.

Prepare a function that shows the contents of an array to the screen and have your main program use that function to show the contents of the three matrixes.

I have the solution already but i do not understand it; I need expert to guide through it step by step. thanks!

Reference no: EM13713053

Questions Cloud

What is the comet''s speed at its perihelion : What is the comet's speed at its perihelion (closest approach to the sun) where the distance from the sun is 8.91 x 1010 m. The orbit of Halley's comment around the Sun is a long thin ellipse.
Design your own three-stage explicit runge-kutta method : Design your own three-stage explicit Runge-Kutta method with one-step error O(h^4) - Confirm that the global error in your numerical solution is O(h^3).
Computes the amount of money the computer club : Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project.
Evaluate the tip amount that should be added : Write a program that will be used to evaluate the tip amount that should be added to a restaurant charge. Allow the user to input the total, before taxes and the tip percentage (15% or 20%).
Write a program which adds two matrices : Write a program which adds two matrices together and displays the sum - Two arrays will contain user input, and the third array will be used to contain the sum of the two arrays.
Calculate and display the miles-per-gallon value : Program that asks the user to enter the number of miles traveled and the number of gallons of gasoline consumed. It should then calculate and display the miles-per-gallon value. Confine your output to 1 decimal place.
Describe the characteristics of laminar airflow : Describe the characteristics of laminar airflow in the boundary layer. Explain in brief of the above problem.
Program that allows users to enter a dollar amount : Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month. Then ask the user to enter a dollar amount for any number of checks written in a month, up to 50.
Write a recursive and iterative versions of binary search : In C++ write a recursive and iterative versions of binary search and compare their run times using the array a[i]=i, i=0,..., n-1 and the given test method:

Reviews

Write a Review

JAVA Programming Questions & Answers

  What secret does soraya tell amir

What secret does soraya tell amir and how does amir react to this information

  Implement a class person with two fields name

Implement a class Person with two fields name and age, and a class Car with three fields - implement a class that saves the details of the person.

  Using a link list implementation

Using a link list implementation, simulate the war car game. The program should read an input of several line of card values and output the winner and the number of rounds it takes.

  Write an application that extends jframe

Write an application that extends JFrame and that displays a phrase in every font size from 6 through 20.

  Program will read parameters plaintext and ciphertextfrom

Specifically, your program will read parameters, plaintext and ciphertextfrom a file named "input.txt" (under the same directory).Then your program needs tocreate a file named "output.txt" (under the same directory) and prints the public key, private..

  Write a java program that prints the numbers from 1 to 125

Write a Java Program that prints the numbers from 1 to 125. But for multiles of three print "Batman" instead of the number and for the multiples of five print "Superman". For instances which are multiples of both three and five "JusticeLeague".

  Write java program prints strings given at command line

Write down the program Average.java which just prints strings which it is given at command line, one per line. If nothing is given at command line, print "No arguments".

  Compute area and perimeter of a polygon

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

  Given a hash function hkey prepare a java simulation

given a hash function hkey prepare a java simulation program to determine each of the subsequent quantities after

  What are the merits and demerits of the use of mainframes

write a 200- to 300-word short-answer response to the followingwhat are the advantages and disadvantages of the use of

  Write an expression that concatenates the string variable

Write an expression that concatenates the string variable suffix onto the end of the string variable prefix.

  Array named peopletypes that can store a maximum

Define a 1-D array named peopleTypes that can store a maximum of 50 integer values that will be entered at the keyboard. Enter a series of 1's, 2's, 3's and 4's into the array, where a 1 represents an infant, a 2 represents a child, a 3 represents..

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