Hello,
As you can see the title, i need help with the loop. Here is the code:
double t;
for(t=0.5;t>2.5;t=t+0.1){
System.out.println(form.format(t));
}
As you can see, the loop keeps going from 0.5 to 2.5. The main problem, that i cant understand how to make it count from 0.5 to 2.5, with this algorythm:
0.5 + 0.1 = 0.6
0.6 + 0.1 = 0.7
0.7 + 0.3 = 1
1 + 0.1 = 1.1
1.1 + 0.1 = 1.2
1.2 + 0.3 = 1.5
1.5 + 0.1 = 1.6
1.6 + 0.1 = 1.7
1.7 + 0.3 = 2
2 + 0.1 = 2.1
2.1 + 0.1 = 2.2
2.2 + 0.3 = 2.5
Iam stuck with this 2 days, and tomorrow i have to show this =(