First is saved by getting the x from the textfile and assigned it to y.
y = x
Second, getting the x from the textfile to calculate y.
y = 2*y + x
Then after that, can calculate the rest.
y[i] = 2*y[i-1] - y[i-2] + x[i]
The output should be the output 'y[i]' only.
May I know to declare arrayList here in 'double' format?Code:
for(int i = 2; i < maxSize; i++)
String data = getNextValue(fileData, i);
double value = parseValue(data);
x[i] = value;
// What's the way to assign the 'double value' as x[i]?
y = x ; //how to read the first value 'x' only?
y = 2*y + x; //how to read the value 'x' only?
y[i] = 2*y[i-1] - y[i-2] + x[i];
System.out.print( "Output file at C drive now" + '\n');