140k views
22 votes
PLEASE HELP

Write a function to describe the following scenario.
A taxi driver charges a $5 flat fee to
enter the car and $0.50 per mile.
What is the total cost of a taxi ride?

User Detlef
by
3.8k points

1 Answer

13 votes

Answer:

Total Fee = $5 + ($0.50/mile)*(x miles)

Explanation:

Let x be the miles driven. The total cast for the mileage alone would be:

($0.50/mile)*(x miles) = mileage fee

Total Fee = $5 + ($0.50/mile)*(x miles)

User Amin Jafari
by
4.6k points