Question: Im not so good at java programming, please I dont understand coding at all its a class I have to take*** The program contructs and
Im not so good at java programming, please I dont understand coding at all its a class I have to take***
The program contructs and prints a
Magic Square. Your program should implement and use the following method.
/**
Constructs a magic square of size n.
Parameters:
n magic square size. n must be an odd integer.
Returns:
When n is odd returns a magic square. When n is even returns null.
**/
private static int[] [] contructMagicSquare(int n)
Test your program with the following magic square sizes: 3, 5, 7, and 8.
Implement the method given in the problem.
Also implement the following method:
/**
* Makes a 2D array (matrix) where the [i][j] element contains the
* average of neighbors of [i][j] element in the input 2D array (values).
*
* for example:
*
* matrix[i][j] = neighborAverage(values, i, j );
*
* @param values 2D input array
*
* @return neighbor average matrix
*/
static double[][] makeNeighborAverageMatrix(int[][] values)
The main method should call makeNeighborAverageMatrix and print the returned 2D array.
Assignment Guidelines:
1. Run your programs with enough test cases to prove that the
program works.
Hand in the output for each test run.
2. For each source file include a comment that contains your name,
assignment number and problem number.
3. Hand in a source code listing (
print out of your Java source
files) and the output produced by your program. Use Courier New
font.
4. Proper indentation.
5. Use Java Language Coding Guidelines (Appendix L) for variable
names, method names, class names and constant names
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
