Question: solve in java please 7. Write a program to calculate the cost of a trip. The program prompts user to enter the distance in miles

solve in java please
solve in java please 7. Write a program to calculate the cost

7. Write a program to calculate the cost of a trip. The program prompts user to enter the distance in miles of the trip, the car efficiency in miles per gallon, and the cost of gas in dollars per gallon. Please limit the print out of the cost to two decimal digits using printf. The following are two sample runs. Sample run 1: Enter the driving distance: Enter miles per gallon: Enter price per gallon: The cost of driving is $20,00 Sample run 2: Enter the driving distance: Enter miles per gallon: Enter price per gallon: The cost of driving is $76.38

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!