subject

In java write a method drivingcost with input parameters drivenmiles, milespergallon, and dollarspergallon, that returns the dollar cost to drive those miles. all items are of type double. if the method is called with 50 20.0 3.1599, the method returns 7.89975.

define that method in a program whose inputs are the car's miles/gallon and the gas dollars/gallon (both doubles). output the gas cost for 10 miles, 50 miles, and 400 miles, by calling your drivingcost method three times.

ex: if the input is 20.0 3.1599, the output is:

1.57995 7.89975 63.198
your program must define and call a method:
public static double drivingcost(double drivenmiles, double milespergallon, double dollarspergallon)

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the can apple do to fix this issue?
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
What are the 12 colors of the spectrum called?
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
You know the right answer?
In java write a method drivingcost with input parameters drivenmiles, milespergallon, and dollarsper...
Questions
question
Mathematics, 15.11.2019 19:31
Questions on the website: 13722362