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

  An int representing the value stored inside the node

In Java, code a doubly linked, sorted list (in ascending order). Each item of the list will just store an int. You need to code three classes: Nade, SortedList, and GroupProject. The Node class has three instance variables, all private: an int..

  Program produces 1000 integer ranging

Then your program produces 1000 integer ranging from 1to 10000 in the array and then sort them in ascending order and then print the result into data.txt file. (You may list integers separated by space or new line)

  Create a file that contains your favorite movie quote

Create a file that contains your favorite movie quote. Use a text editor such as Notepad, and save the file as quote.txt. Copy the file contents,

  List data structures to be used in solution

write a program that will prompt the user for an input file name to read from. The Input file will consist of records made up of first name, last name and an account balance of individuals and store the individuals in an ArrayList.

  Alter the prototype form page by javascript function

Alter the prototype form page so that when JavaScript function has verified that all the required fields have been filled, cookie is added to user's computer.

  Tasks for an array of integers

Write array methods that carry out the subsequent tasks for an array of integers by completing the ArrayMethods class below. Test each method.

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

  Design a course registration system

Create an application which represents a simplified course registration system using ArrayLists and HashMaps.

  Java program which handles events from different sources

how to setup a program to respond to events from any one of these sources. How do you create the necessary listener class? How do you associate the listener object with the event source?

  Point of sale terminal

a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sales terminals of the store. The users can use the system to manage sales items in the store, customer details and of c..

  Uses a 2-d array to store the highest and lowest temperature

Write a program that uses a 2-D array to store the highest and lowest temperatures for each montjh of the year. The program should output the average high, average low, and highest and lowest temperatures of the year. Your program must consist of ..

  Write java program which simulates flipping of coin

Write a Java program which simulates flipping of coin 1000 times and prints total number of heads and tails. You should create a class.

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