Saturday, December 6, 2014

Two dimensional array question?
















I am trying to create a program for class the uses two dimensional arrays. I am stuck on the second step that states Use two parallel arrays. One is a two-dimensional array -- a row of this array will hold six values in this order: [0] number of hours worked, [1] hourly pay rate, [2] gross pay, [3] net pay, [4] federal withholding, and [5] state withholding.
















This is what I have so far:
























Java Code:




















double [][] data = new double [30][6];
String [] names = new String [30];
String str = null;
String detail = null;
int n = input(data, names, inputFile);


















(there's more but i don't believe it pertains to this question)







My question is how would I create this array. Or, is that right above? I've searched online and in my book and I just don't understand.































No comments:

Post a Comment