You're testing only for the one case in which the score is precisely 0.5, for the disp statement not that the score is a multiple of 0.5.
The syntax is wrong for find, the second (optional) argument is the number of elements to find and must be an integer, not the value to match. find evaluates a logical condition so the correct syntax to find the element in the lookup array would be
That is, however, a somewhat wasteful approach, consider what
returns for various scores and what test would satisfy the condition desired? Then you can simply ensure that the score is also >0 and <= whatever the maximum allowable would be.
Best Answer