0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>The time has come to create the third own program, which will help Muffin properly stock up on protein for any period, for example, for 15 or 25 days.</p>
1
<p>The time has come to create the third own program, which will help Muffin properly stock up on protein for any period, for example, for 15 or 25 days.</p>
2
<p>The peculiarity of Muffin’s diet is that the amount of protein on even and odd days is different. Anyway, here is the technical assignment written by Muffin’s paw:</p>
2
<p>The peculiarity of Muffin’s diet is that the amount of protein on even and odd days is different. Anyway, here is the technical assignment written by Muffin’s paw:</p>
3
<blockquote><p>Meow! The program should calculate how much protein I need to drink for the entire training period.</p>
3
<blockquote><p>Meow! The program should calculate how much protein I need to drink for the entire training period.</p>
4
<p>On even days, I drink 200 grams. On odd days 100 grams.</p>
4
<p>On even days, I drink 200 grams. On odd days 100 grams.</p>
5
<p>The number of days is stored in variable days, the amount of protein to consume on an even day in variable evenDayAmount, protein on an odd day in variable oddDayAmount, and the result must be written into variable total, which is already defined.</p>
5
<p>The number of days is stored in variable days, the amount of protein to consume on an even day in variable evenDayAmount, protein on an odd day in variable oddDayAmount, and the result must be written into variable total, which is already defined.</p>
6
</blockquote><p>In this program, it is convenient to use a loop in which the amount of protein will accumulate. Note that in the task, you work with days, therefore<strong>days must be counted from 1</strong>, and not from 0.</p>
6
</blockquote><p>In this program, it is convenient to use a loop in which the amount of protein will accumulate. Note that in the task, you work with days, therefore<strong>days must be counted from 1</strong>, and not from 0.</p>
7
<p>In order for the task to be solved correctly, we must determine how many even and odd days there are in a period. Use the % operator to do this (remainder in division).</p>
7
<p>In order for the task to be solved correctly, we must determine how many even and odd days there are in a period. Use the % operator to do this (remainder in division).</p>
8
<p>To call Muffin to check the program, press the Hey boss, here’s your program! button located in the console.</p>
8
<p>To call Muffin to check the program, press the Hey boss, here’s your program! button located in the console.</p>