# java coding

*label*Programming

*timer*Asked: Jun 10th, 2018

*account_balance_wallet*$70

**Question description**

** Question 1 ** Design a Java program to implement matrix arithmetic for square matrices (same number of rows and columns). You will need to use your math textbook or the Internet to review operations with matrices.Make sure that your program is calling methods to perform (at least) the following operations:

**Generate**: Generate a matrix with values 1 - 10

**Addition:** See __http://mathworld.wolfram.com/MatrixAddition.html____ __**Subtraction:** Figure it out!**Multiplication**

-- Multiply two matrices: See __http://mathworld.wolfram.com/MatrixMultiplication.html____ __

-- Multiply a matrix by a constant: Equivalent to multiplication of each element by that constant.

**Transposition:** See __http://mathworld.wolfram.com/Transpose.html____ __

**Matrix Trace:** See __http://mathworld.wolfram.com/MatrixTrace.html____ __

**Print (**use printf**)**

Have another method called **menu()**, that should list the options for matrix operations for which you designed the previous functions, and an option to exit the program. Your program should loop until the user chooses to exit. In this loop you are required to use a **switch** statement for all possible cases.

//Please DONT forget to add comment for each step.

Focus on good design, good style, and, most importantly, reuse of code

## Tutor Answer

Attached.

import java.util.Scanner;

public class Matrices {

public static void main(String[] args) {

int choice = 5;

//number of...

*flag*Report DMCA

Brown University

1271 Tutors

California Institute of Technology

2131 Tutors

Carnegie Mellon University

982 Tutors

Columbia University

1256 Tutors

Dartmouth University

2113 Tutors

Emory University

2279 Tutors

Harvard University

599 Tutors

Massachusetts Institute of Technology

2319 Tutors

New York University

1645 Tutors

Notre Dam University

1911 Tutors

Oklahoma University

2122 Tutors

Pennsylvania State University

932 Tutors

Princeton University

1211 Tutors

Stanford University

983 Tutors

University of California

1282 Tutors

Oxford University

123 Tutors

Yale University

2325 Tutors