Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create an application named SquareMatrixCenter whose main method askes the user to enter an integer number n (between 2 and 10), and an n by

Create an application named SquareMatrixCenter whose main method askes the user to enter an integer number n (between 2 and 10), and an n by n integer matrix then passes the matrix with the values entered by the user to the following method:

static void printMatrixCenter(int [][] matrix): prints the square matrix at the center of the given matrix, that is all the numbers of the given matrix except those on the first and last row, and first and last column.

Use the Scanner class to read the users input.

Example 1.

Input:

Please enter an integer between 2 and 10: 4

Please enter a 4 by 4 matrix:

5 7 7 8

12 0 -5 15

3 12 9 10

7 3 8 7

Output:

The center of the matrix is :

0 -5

12 9

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

8. discuss the concept of mindfulness.

Answered: 1 week ago