HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>After a couple of meowtalities, the popularity growth of the video blog was resumed, and the updated version of the analyzer program eliminated all the cheating. Now Muffin can devote himself to his favorite thing to do.</p>
1 <p>After a couple of meowtalities, the popularity growth of the video blog was resumed, and the updated version of the analyzer program eliminated all the cheating. Now Muffin can devote himself to his favorite thing to do.</p>
2 <p>Every year the boss participates in all-cat competitions in long jumps from the wall. Competitions are held among the best cats in the country and require serious preparation.</p>
2 <p>Every year the boss participates in all-cat competitions in long jumps from the wall. Competitions are held among the best cats in the country and require serious preparation.</p>
3 <p>Selection for competitions is tough, it’s hard to qualify for them, and that’s Muffin needs a program that runs qualification rounds according to the rules of the championship. Anyway, here is the technical assignment:</p>
3 <p>Selection for competitions is tough, it’s hard to qualify for them, and that’s Muffin needs a program that runs qualification rounds according to the rules of the championship. Anyway, here is the technical assignment:</p>
4 <blockquote><p>Meow! I train regularly and I want to understand if I will qualify.</p>
4 <blockquote><p>Meow! I train regularly and I want to understand if I will qualify.</p>
5 <p>During the training I do a few jumps and collect the lengths of the jumps into the array attempts.</p>
5 <p>During the training I do a few jumps and collect the lengths of the jumps into the array attempts.</p>
6 <p>The qualification value is stored in the qualificationDistance variable.</p>
6 <p>The qualification value is stored in the qualificationDistance variable.</p>
7 <p>The program must choose the three best jumps, calculate the average value of these three jumps and write it into the averageBest variable.</p>
7 <p>The program must choose the three best jumps, calculate the average value of these three jumps and write it into the averageBest variable.</p>
8 <p>If the average of the best three jumps is greater than the qualification value, then I passed the qualification and variable qualified must contain true. If qualification round is not passed, then qualified must contain false.</p>
8 <p>If the average of the best three jumps is greater than the qualification value, then I passed the qualification and variable qualified must contain true. If qualification round is not passed, then qualified must contain false.</p>
9 </blockquote><p>You can find the best three values in different ways. You can sort the array in ascending order (you already know how to do it) and take the last three elements (you practiced that as well).</p>
9 </blockquote><p>You can find the best three values in different ways. You can sort the array in ascending order (you already know how to do it) and take the last three elements (you practiced that as well).</p>
10 <p>You can test yourself and try to sort the array in descending order. Then after the sorting, the best three values will be at the beginning of the array.</p>
10 <p>You can test yourself and try to sort the array in descending order. Then after the sorting, the best three values will be at the beginning of the array.</p>
11 <p>When you are done, press Hey boss, here’s your program!</p>
11 <p>When you are done, press Hey boss, here’s your program!</p>