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 04:20
Which network media uses different regions of the electromagnetic spectrum to transmit signals through air? uses different regions of the electromagnetic spectrum to transmit signals through air.
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
What is the name of the sound effect that danny hears
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Font size, font style, and are all aspects of character formatting.
Answers: 2
You know the right answer?
In java write a method drivingcost with input parameters drivenmiles, milespergallon, and dollarsper...
Questions
question
Mathematics, 22.08.2019 19:30
question
Mathematics, 22.08.2019 19:30
Questions on the website: 13722361