I have a Bidimensional array called "info", "n" rows and "7" columns. Which I go through with the following code:
Note: I start to go through the array starting from column "1";
for (int x=0; x < info.length; x++){
double a=0.0, b=0.0;
for (int y=1; y < info[x].length; y++){
double numEntero = Double.parseDouble(info[x][y]);
a=(a+numEntero);
b=(a/7);
}
System.out.println(b);
}
At the end of the for cycle, he throws this at me:
9.857142857142858
9.257142857142856
7.914285714285713
8.285714285714286
8.085714285714285
9.285714285714283
9.057142857142859
9.4
10.0
As you may notice, the original arrangement is String, (which contains numbers) and I convert to double the data stored in it. I add the columns from "1" to "7" (since I omit column 0) and divide them by "7". At the end I store them in a double variable called "b".
Is there any way to pass the variable "b" to a new one-dimensional array ?, that is, to pass this result to a new Array. Will it be possible?
9.857142857142858
9.257142857142856
7.914285714285713
8.285714285714286
8.085714285714285
9.285714285714283
9.057142857142859
9.4
10.0
I would greatly appreciate your help:)