This page contains an archived post to the Java Answers Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Plz Help with Bi-dimensional array
Posted by Kajool on October 05, 2001 at 5:29 PM
I need your help in a java assigments,the task is to:
1.create a bi-dimensioanl array of a number which is enterd from dos prompt into args array and the number should be odd number:
java Test 5 or java Test 9
2.Now 1 should be stored in mid of the array
for example if I enter 9 at dos prompt ,so the value 1 should be stored at row # 0 and column # 5 of the array
which is the midd # of 9.
now throw a loop you have to make a table like: e.g
if I pass 3 at dos prompt and an array of 3 by 3 is created .
so at last when I print it it should look like this
8 1 6
3 5 7
4 9 2
so If I calculate them in any order it will result 15.
3.the example I gave was only of a 3 by 3 array
it should work the same with 7 by 7 bi-array or 9 by 9 bi- array and so on.
Tanx in advacne