Write a C program to calculate the taxi fare based on the taxi type and the travel distance. The fare
consists of a base fare depending on the taxi type, and a distance-based fare:
Base fare by taxi type:
Economic taxi ('E'): Fixed fare of 3 USD.
o Luxury taxi ('L'): Fixed fare of 6 USD.

Distance-based fare:
o The first 5 km: 1.5 USD per km
o From 6 to 10 km: 1.25 USD per km
o Over 10 km: 1 USD per km
The total fare is the sum of base fare and the distance-based fare.
Input
A single character, t, and an integer, d, separated by a space, representing the taxi type and the travel
distance, respectively.
Class:
Practical Paper
PRF192 Examination 01
Constraints

te (E', 'L'}

den
• 0<d<500
Output
One number representing the total fare, formatted to two decimal places.
Sample
testcase
Input Output Explanation
Testease 1 E7 13.00
Base fare for Economic taxi: 3 USD
=
7.5 USD
FUOestease 2 L 12 21.75
FUDVERFLOW.COM
First 5 km: 5* 1.5
Next 2 km: 2* 1.25
=
2.5 USD
Total fare: 37.5 + 2.5 = 13.00 USD
Base fare for Luxury taxi: 6 USD
2/3