Functions and return values

Predict the full cost for each rider count, with a fare of 5 per person and an extra 2 per trip.

Examples

Example 1

Input
1
Expected output
7

Example 2

Input
4
Expected output
22

Hints and solution

Hint 1

Apply the extra fee once after multiplying.

Reveal worked answer

The function returns riders * 5. The final operation adds 2. For four riders the full cost is 22.

Back to the lesson