Cirugia Toracica what about the following:

```
"-- these are the results from highest to lowest --"
let results := [3, 2, 1];
"-- these are the upper boundaries for any result --"
let boundaries := [10, 7.5, 5];
"-- initialise the result with the highest possible value --"
let result := 4;
"-- go down from boundary to boundary and check --"
for i from 0 to 3 do
if myValue < item(boundaries, i) then result := item(results, i) end;
end;
```

You can always extend the results in the array to whatever maximum value you like, you don't even need to have a sequence of numbers, you can assign any result you like.

If you extend the number of results, you also have to extend the number of boundaries. Any value is possible, as long as they are in descending order.

The initialisation can also be with any value you like.

Finally you have to adapt the for-loop to the number of results. I. e. if you have 6 results, the results array will have five entries and you have "for i from 0 to 5".

You can also create a function for that:

```
function rating(n : number) do
let results := [3, 2, 1];
let boundaries := [10, 7.5, 5];
let result := 4;
for i from 0 to 3 do
if n < item(boundaries, i) then result := item(results, i) end;
end;
result;
end;
rating(8.8)
```

The advantage is, that the number of ifs and switches etc. gets not larger if you have more cases to differentiate. You just adapt some numbers