Please Help Me I Appreciate
I am doing a Java program on sequences for my computer studies project.
The linear sequences are sequences that have the same difference example 2, 4, 6, 8, 10 (a difference of 2) or 55, 66, 77, 88, 99(a difference of 11). To find out the difference my program gets the last number and reduces the number before it (ex: 99 - 88=11, 88 - 77=11, 77 - 66=11). If the differences obtained are not equal it means that it is not a linear sequence. My problem is that when I enter a sequence with a decimal point like this 5.5, 6.6, 7.7, 8.8, 9.9 (so it has a difference of 1.1) it tells me that it is not a linear sequence. Can you tell me what`s the problem please. BTW I am using jcreator.