Question: Design pseudocode and implement (source code) a program (name it DrivingCost) to compute the cost of a road trip. The program prompts the user to

Design pseudocode and implement (source code) a program (name it DrivingCost) to compute the cost of a road trip. The program prompts the user to enter the distance to be traveled, the car fuel efficiency (mile per gallon), and the fuel cost per gallon. The program computes and displays the trip cost. Document the code
Sample run 1:
Distance traveled (miles): 100
Miles per gallon (miles): 20
Price per gallon (dollars): 2.0
Trip cost (dollars): 10.00
Sample run 2:
Distance traveled (miles): 500
Miles per gallon (miles): 35
Price per gallon (dollars): 2.50
Trip cost (dollars): 35.71
Sample run 3:
Distance traveled (miles): 78
Miles per gallon (miles): 25
Price per gallon (dollars): 3.0
Trip cost (dollars): 9.36

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 Databases Questions!