A taxi ride costs P40.00 as plug down rate and each additional meter(or a fraction of there of)adds Php4.00 to the fare.Use a function to represent the taxi fare in terms of distance in meters
Answers
Answer:
Write a function called taxi_fare that computes the fare of a taxi ride. It takes two inputs: the distance in kilometers (d) and the amount of wait time in minutes (t). The fare is calculated like this:
the first km is $5
every additional km is $2
and every minute of waiting is $0.25.
Once a km is started, it counts as a whole (Hint: consider the ceil built-in function). The same rule applies to wait times. You can assume that d >0 and t >= 0 but they are not necessarily integers. The function returns the fare in dollars. For example, a 3.5-km ride with 2.25 minutes of wait costs $11.75. Note that loops and if-statements are neither necessary nor allowed.
SOLUTION
GIVEN
A taxi ride costs P40.00 as plug down rate and each additional meter (or a fraction of there of) adds Php4.00 to the fare.
TO DETERMINE
Use a function to represent the taxi fare in terms of distance in meters
EVALUATION
Let the taxi fare is F for d meters
Now it is given that the taxi ride costs P40.00 as plug down rate
Also each additional meter (or a fraction of there of) adds Php4.00 to the fare
Thus we get from above
F = 40 + 4d
Which is the required function
FINAL ANSWER
Hence the required function is
F = 40 + 4d
━━━━━━━━━━━━━━━━
Learn more from Brainly :-
Kyle owns an orchard nearby. He wants to charge one flat rate per pound for his apples no matter how much someone buys. ...
https://brainly.in/question/40419271
2. isabella belongs to a fitness club. she paid an inital fee of 50 when she joined and also pays 10 per month.
https://brainly.in/question/40648040