Originally Posted by
hiimjoey11
Good point. Sorry about that. Here are the directions Magic Square:
a. Write a method createArithmeticSeq that prompts the user to input two numbers, first and diff. The method then creates a one-dimensional array of 16 elements ordered in an arithmetic sequence. It also outputs the arithmetic sequence. For example, if first=21 and diff =5, the arithmetic sequence is: 21 26 31 36 41 46 51 56 61 66 71 76 81 86 91 96.
b. Write a method matricize that takes a one-dimensional array of 16 elements and a two-dimensional array of 4 rows, and 4 columns as parameters. This method puts the elements of the one-dimensional array into the two-dimensional array. For example, if A is the one dimensional array created in part A, and B is a two dimensional arrray, then after putting the elements of A into B, the array B is:
21 26 31 36
41 46 51 56
61 66 71 76
81 86 91 96
Part a is working fine, i just need help with part b. Thanks again!