0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<p>You were just getting into the office when you received a letter from Muffin that was labeled as “urgent”.</p>
1
<p>You were just getting into the office when you received a letter from Muffin that was labeled as “urgent”.</p>
2
<blockquote><p>Meow! I want to go on vacation. They say that there is some delicious salmon in Irkutsk: I got so fed up with St. Petersburg fish.</p>
2
<blockquote><p>Meow! I want to go on vacation. They say that there is some delicious salmon in Irkutsk: I got so fed up with St. Petersburg fish.</p>
3
<p>Count how many bonus air miles I can get if I fly with MuffAir. My gut feeling as an avid discount hunter suggests that I can make a profit here.</p>
3
<p>Count how many bonus air miles I can get if I fly with MuffAir. My gut feeling as an avid discount hunter suggests that I can make a profit here.</p>
4
<p>The distance to Irkutsk is 4125 km. The number of air miles is 25% of this distance.</p>
4
<p>The distance to Irkutsk is 4125 km. The number of air miles is 25% of this distance.</p>
5
<p>I’m waiting for the result!</p>
5
<p>I’m waiting for the result!</p>
6
</blockquote><p>For a start, let’s clarify what “air miles” are. These are bonuses from airlines that can be accumulated after each flight, and then these miles can be used to “pay” for a flight to a certain city. Bonus miles are accrued in different ways. In MuffAir, as we have already learned, bonuses constitute a percentage of the flight distance.</p>
6
</blockquote><p>For a start, let’s clarify what “air miles” are. These are bonuses from airlines that can be accumulated after each flight, and then these miles can be used to “pay” for a flight to a certain city. Bonus miles are accrued in different ways. In MuffAir, as we have already learned, bonuses constitute a percentage of the flight distance.</p>
7
<p>In our code, the distance is stored in variable distance, and the percentage is already converted to a fractional number and stored in variable percent.</p>
7
<p>In our code, the distance is stored in variable distance, and the percentage is already converted to a fractional number and stored in variable percent.</p>
8
<p>These values are enough to get the right number of miles: multiply the distance by percentage.</p>
8
<p>These values are enough to get the right number of miles: multiply the distance by percentage.</p>