0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>Your task is to develop a fitness calculator for Muffin. Here is a functional specification written by his very pawn:</p>
1
<p>Your task is to develop a fitness calculator for Muffin. Here is a functional specification written by his very pawn:</p>
2
<blockquote><p>Meow! I need to shape up by CatFashionExpo2018. And I need my own special fitness calculator for that.</p>
2
<blockquote><p>Meow! I need to shape up by CatFashionExpo2018. And I need my own special fitness calculator for that.</p>
3
<p>I enter the amount of food I ate in grams and the number of hours that I slept last night, and it creates a training program from the following exercises:</p>
3
<p>I enter the amount of food I ate in grams and the number of hours that I slept last night, and it creates a training program from the following exercises:</p>
4
<ul><li>jumps onto the bookcase (strength training for hind legs)</li>
4
<ul><li>jumps onto the bookcase (strength training for hind legs)</li>
5
<li>pull-ups on the master’s hanging coat (strength training for front legs),</li>
5
<li>pull-ups on the master’s hanging coat (strength training for front legs),</li>
6
<li>running in circles around the room (stamina improvement).</li>
6
<li>running in circles around the room (stamina improvement).</li>
7
</ul><p>Here is the calculator’s algorithm:</p>
7
</ul><p>Here is the calculator’s algorithm:</p>
8
We store the weight of the food in the foodInGrams variable. The sleep time is stored in the sleepInHours variable. We will be saving integers to both variables. I will get 3 jumps for every 10 grams of the food I ate. For example: need to make 15 jumps for eating 50 grams of food. We’ll store the jumps count in the jumps variable. For every hour of sleep, I get 2 pull-ups. For example: I slept for 5 hours and now have to do 10 pull-ups. We’ll store the pull-ups count in the pulls variable. Each jump comes with a round of running, each pull-up, a half of a round. For example: you get 20 rounds around the room for 15 jumps and 10 pull-ups. We’ll store the runs count in the runs variable.<p>It would be better to log the values of variables in the console.</p>
8
We store the weight of the food in the foodInGrams variable. The sleep time is stored in the sleepInHours variable. We will be saving integers to both variables. I will get 3 jumps for every 10 grams of the food I ate. For example: need to make 15 jumps for eating 50 grams of food. We’ll store the jumps count in the jumps variable. For every hour of sleep, I get 2 pull-ups. For example: I slept for 5 hours and now have to do 10 pull-ups. We’ll store the pull-ups count in the pulls variable. Each jump comes with a round of running, each pull-up, a half of a round. For example: you get 20 rounds around the room for 15 jumps and 10 pull-ups. We’ll store the runs count in the runs variable.<p>It would be better to log the values of variables in the console.</p>
9
</blockquote><p>Calculate the number of circles, if the food weight is 300 grams and the sleep time is 10 hours.</p>
9
</blockquote><p>Calculate the number of circles, if the food weight is 300 grams and the sleep time is 10 hours.</p>
10
// How many 10-gram parts there are in the food 300 / 10 = 30; // Number of jumps // For each 10 grams, 3 jumps are added 30 * 3 = 90 // Number of pull-ups // For each hour of sleep, 2 pull-ups are added 10 * 2 = 20 // Number of circles for jumps // For each jump - one circle to run 90 * 1 = 90 // Number of circles for pull-ups // For each pull-up - half a circle 20 / 2 = 10 // Total number of circles 90 + 10 = 100<p>This is an unusual task. The boss will be testing our program by passing different values to input variables and checking the recommendations shown by the program. Once the tests have been successfully passed, the task will be completed.</p>
10
// How many 10-gram parts there are in the food 300 / 10 = 30; // Number of jumps // For each 10 grams, 3 jumps are added 30 * 3 = 90 // Number of pull-ups // For each hour of sleep, 2 pull-ups are added 10 * 2 = 20 // Number of circles for jumps // For each jump - one circle to run 90 * 1 = 90 // Number of circles for pull-ups // For each pull-up - half a circle 20 / 2 = 10 // Total number of circles 90 + 10 = 100<p>This is an unusual task. The boss will be testing our program by passing different values to input variables and checking the recommendations shown by the program. Once the tests have been successfully passed, the task will be completed.</p>
11
<p>To invite Muffin to test the program, click the Hey boss, here’s your program! button in the console.</p>
11
<p>To invite Muffin to test the program, click the Hey boss, here’s your program! button in the console.</p>