Final answer:
To write a program that calculates the parking fee at an international airport, you can use an if-else statement to check the number of hours the car is parked and calculate the fee accordingly.
Step-by-step explanation:
To write a program that calculates the parking fee, you can use an if-else statement to check the number of hours the car is parked and calculate the fee accordingly. Here's a step-by-step explanation:
- Prompt the user to enter the number of hours the car is parked.
- Read the input and store it in a variable, let's say 'hours'.
- Use an if-else statement to check the value of 'hours' and calculate the fee based on the given formula.
- If 'hours' is between 0 and 3, set the fee 'F' to 5.
- If 'hours' is between 3 and 9, calculate 'int(h+1)' and set 'F' to 63 times 'int(h+1)' minus 11.
- If 'hours' is between 9 and 24, set 'F' to 60.
- Output the value of 'F' as the parking fee.