- script.js
JavaScript
var qualificationDistance = 200;
var attempts = [120, 150, 160, 201, 203, 180, 202];
var qualified = false;
var averageBest = 0;
/* Technical assignment
Meow! I train regularly and I want to understand if I will qualify.
During the training I do a few jumps and collect the lengths of the jumps into the attempts array.
The program must choose the three best jumps, calculate the average value of these three jumps and write it into the averageBest variable.
The qualification value is stored in the qualificationDistance variable.
If the average of the best three jumps is greater than the qualification value, then I qualified and variable qualified must contain true. If I didn’t qualify, then qualified must contain false.
*/