HTML Diff
0 added 0 removed
Original 2026-01-01
Modified 2026-03-09
1 <p>You are ready to write the fourth program that the boss will test with his own paws. Here is the technical assignment:</p>
1 <p>You are ready to write the fourth program that the boss will test with his own paws. Here is the technical assignment:</p>
2 <blockquote><p>Meow! I’m tired of diet and exercise, and that’s why I want to know how many more days I need to exercise to achieve the right weight for the event.</p>
2 <blockquote><p>Meow! I’m tired of diet and exercise, and that’s why I want to know how many more days I need to exercise to achieve the right weight for the event.</p>
3 <p>Input data: weight at the beginning of the diet and weight at the end of the diet.</p>
3 <p>Input data: weight at the beginning of the diet and weight at the end of the diet.</p>
4 <p>Work logic: if I exercise and diet, I lose 5% of my weight per day (you can’t really gain any weight on dry food, and my exercise sessions are harsh). And I exercise as long as my weight is greater than desired.</p>
4 <p>Work logic: if I exercise and diet, I lose 5% of my weight per day (you can’t really gain any weight on dry food, and my exercise sessions are harsh). And I exercise as long as my weight is greater than desired.</p>
5 <p>Just count how many days you need to stick to this routine and write the number in the days variable.</p>
5 <p>Just count how many days you need to stick to this routine and write the number in the days variable.</p>
6 </blockquote><p>Of course, for this program, it is more convenient to use while, since the number of iterations is unknown beforehand.</p>
6 </blockquote><p>Of course, for this program, it is more convenient to use while, since the number of iterations is unknown beforehand.</p>
7 <p>Note that every day Muffin loses 5% of his weight. And the weight is updated every day. For example, if at first the Muffin weighed 5 kg (that is 5000 grams), then the next day his weight will be 4750 grams. And on the second day, he will lose 5% of the new weight, that is, from 4750 grams. Take this into account when calculating.</p>
7 <p>Note that every day Muffin loses 5% of his weight. And the weight is updated every day. For example, if at first the Muffin weighed 5 kg (that is 5000 grams), then the next day his weight will be 4750 grams. And on the second day, he will lose 5% of the new weight, that is, from 4750 grams. Take this into account when calculating.</p>
8 <p>To call the Muffin to check the program, press the Hey boss, here’s your program! button located in the console.</p>
8 <p>To call the Muffin to check the program, press the Hey boss, here’s your program! button located in the console.</p>