Interactive online courses HTML Academy
2026-03-09 12:22 Diff

You were just getting into the office when you received a letter from Muffin that was labeled as “urgent”.

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.

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.

The distance to Irkutsk is 4125 km. The number of air miles is 25% of this distance.

I’m waiting for the result!

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.

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.

These values ​​are enough to get the right number of miles: multiply the distance by percentage.