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

  Develop a reservation system program for specific flights.

develop a reservation system program for specific flights. A customer should be able to select from one of four categories of seats on flights from RDU to any of at least three other destinations. Based on the user input of seat type and destination,..

  Write a program that reads in a list of numbers from a file

write a program that reads in a list of numbers from a file and adds up all those numbers. You may hard code in the name of the file, allowing the user to input the filename is not required

  Have an array of integers with user input instead of given

change the current code to have an array of integers with user input intead of given input from the main where it says int[] a=....; And also from a text file but the same numbers as what is given in main.

  Writing an applet with graphics in this programming

writing an applet with graphics in this programming activity you will write an applet that uses graphics. you will draw

  Alicia creates a button using the code jbutton exit button

Alicia creates a button using the code JButton exitButton = new JButton("exit"); and places it into a JFrame named mainFrame

  Write a java program that generate and recognise identifier,

Write a java program that generate and recognise identifier, keyword, delimiter, arithmetic operator

  Create a histogram bar

Demonstrates an example of the user interface during your program's execution

  Java project

Prompt the user for an int between lower and upper boundary.

  Be sure to show all declarations

Write a function call that invokes function a. Be sure to show all declarations. However a complete main is not required.

  Create the java code for a generic class

Create the Java code for a generic class. The class should contain at least one private data member of a generic type, a constructor which initializes the private data member to the value of a passed in argument, and a getter and setter for the ge..

  Balanced and competitive business practices

The United States has several laws that are intended to further fair, balanced, and competitive business practices. Do you think that such laws are effective? If so, why? If not, why not? Be sure to provide evidence to support your position one way o..

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

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