Question: Problem Specification: A cab company needs a program to calculate the fare for a cab ride. The user will enter the length of the trip

Problem Specification:
A cab company needs a program to calculate the fare for a cab ride.
The user will enter the length of the trip in miles. Create a function that returns a value greater than zero to get this value from the user.
Create a function to calculate the charge. The function should receive one argument, the length of the trip, and should return the total fare for the ride.
The taxi fare is a fixed charge of $2.50, plus an additional charge of $1.75 per mile.
Display the trip fare formatted for currency.
Allow the user to calculate any number of trips.
At the end display the total of all the fares.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!