Good Morning
I hope I can explain a problem that I've tried to code but having problems with.
I have an array of 20 numeric values and the each value is passed (in a loop) along with a fixed value (1.50) to a function that returns the difference between the two.
I have the function coded and working correctly.
for instance
array[0] - 1.50 = 3
array[1] - 1.50 = 2
array[2] - 1.50 = 0.5
etc etc
This has to be done in the loop until the the program finds the first element in the array with a difference of less than 1.
So for instance in the example above if the value of array[2] = 2. then the loop would stop there as it's the first element in the array with a difference < 1.
I can't get the loop structure coded correcty, I trust I need a while loop and a for loop.
Hope you can see the problem and help if possible. Please let me know if you need clarificatiion.
Regards
JS


LinkBack URL
About LinkBacks
Reply With Quote
by clicking the
button on their useful posts.