Activity : Algorithms
Selection for a Hurdle team depends on trials. Competitors are rated 'Definite', 'Possible' or 'Fail' depending on the time they complete the trial and the number of hurdles they knock over.

 The algorithm used is as follows...

Statement  
1 input(CompletionTime)
2 input(HurdlesKnockedOver)
3 if (CompletionTime < 20 AND HurdlesKnockedOver < 2)
4     then output('Definite')
5     else if ((CompletionTime < 20 AND HurdlesKnockedOver < 3) OR 
             (CompletionTime < 25 AND HurdlesKnockedOver <2))
6         then output('Possible')
7         else output('Fail')
What would be the rating for a competitor completing the race in 22 seconds but knocking down 1 hurdle?
What would be the rating for a competitor completing the race in 19 seconds but knocking down 1 hurdle?
What would be the rating for a competitor completing the race in 26 seconds without knocking down any hurdles?
What would be the rating for a competitor completing the race in 15 seconds but knocking down all 9 hurdles?
What would be the rating for a competitor completing the race in 18 seconds but knocking down 2 hurdles?

   Back