Question: PLEASE USE JAVA Problem 6: Cost of Driving (CostOfDriving.java) Description: Write a program that prompts the user to enter the distance to drive, the fuel

 PLEASE USE JAVA Problem 6: Cost of Driving (CostOfDriving.java) Description: Write

PLEASE USE JAVA

Problem 6: Cost of Driving (CostOfDriving.java) Description: Write a program that prompts the user to enter the distance to drive, the fuel efficiency of the car in miles per gallon, and the price per gallon, and displays the cost of the trip. Please format your output so that the output floating-point number is of scale of 2 (with 2 digits after the decimal point). $ java CostOfDriving Please enter the driving distance: 900.5 Please enter miles per gallon: 25.5 Please enter price per gallon: 3.55 The cost of driving is: $125.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!