1 Attachment(s)
Solving this equations problem in Java
Previously messed up, so I explain here my problem more details.
The problem is like this:
y0 = x0
y1 = 2*y0 + x1
y2 = 2*y1 - y0 + x2
y3 = 2*y2 - y1 + x3
y4 = 2*y3 - y2 + x4
y5 = 2*y4 - y3 + x5
y6 = 2*y5 - y4 + x6
y7 = 2*y6 - y5 + x7
y8 = 2*y7 - y6 + x8
y9 = 2*y8 - y7 + x9
y10 = 2*y9 - y8 + x10
and continues until the maximum number in a text file.
"x0" is the first number in the text file and so on.
Here my text file name is "Xdata.txt" that contains:
Code:
1.2
-1.7
0.8
4.6
0.9
1.0
0.0
5.4
3.9
9.2
1.5
4.92
-0.5
3.7
2.5
8.0
9.8
-0.8
1.0
2.0
The program read from the "Xdata.txt" and get all the outputs into "Ydata.txt"
Maximum number I mean here is the numbers that the textfile have from beginning until the last one.
What I mean is like this, x0 is the first number in the text file until the last value in the text file.
My text file name is "Xdata.txt" contains X0 until the last X19, so there is maximum of 20 numbers.
x0 = 1.2
x1 = -1.7
x2 = 0.8
x3 = 4.6
x4 = 0.9
x5 = 1.0
until
X19 = 2.0
:)