1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Furkat [3]
3 years ago
10

Write a method drivingCost() with input parameters drivenMiles, milesPerGallon, and dollarsPerGallon, that returns the dollar co

st 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.
Computers and Technology
1 answer:
aleksklad [387]3 years ago
8 0

Answer:

public static double drivingCost(int drivenMiles, double milesPerGallon,double dollarsPerGallon){

       return (drivenMiles/milesPerGallon)*(dollarsPerGallon);

   }

Find a complete java program that prompts the user to enter this values and the calls this Method in the explanation section.

Explanation:

<em>import java.util.Scanner;</em>

<em>public class ANot {</em>

<em>    public static void main(String[] args) {</em>

<em>    Scanner in = new Scanner(System.in);</em>

<em>        System.out.println("Please Enter the Driven Miles");</em>

<em>        int drivenMiles = in.nextInt();</em>

<em />

<em>        System.out.println("Please Enter the Your fuel consumption in miles/gallon");</em>

<em>        double milesPerGallon = in.nextDouble();</em>

<em />

<em>        System.out.println("Please Enter the cost of fuel in Dollars/gallon");</em>

<em>        double dollarsPerGallon = in.nextDouble();</em>

<em />

<em>        double dollarCost = drivingCost(drivenMiles,milesPerGallon,dollarsPerGallon);</em>

<em>        System.out.println("The Total Cost in Dollars is "+dollarCost);</em>

<em>        }</em>

<em>    public static double drivingCost(int drivenMiles, double milesPerGallon,double dollarsPerGallon){</em>

<em />

<em>        return (drivenMiles/milesPerGallon)*(dollarsPerGallon);</em>

<em>    }</em>

<em>}</em>

You might be interested in
Which of the following is the most effective password?
timurjin [86]
It seems like <span>xK6D(#dsswuJD would be best because it has several "special characters" as well as capitals, lower cases, and numbers.</span><span /><span>
</span>
8 0
4 years ago
Read 2 more answers
Winston typically spends about $200 per year playing the lottery. If he took that same amount of money, for 30 years, and invest
Tatiana [17]

Answer:

If Winston invested $200 every year at 6% for 30 years, the $200 would be an annuity and the future value of an Annuity is calculated

as:= Annuity x ( (1 + rate) ^ number of years - 1) / rate = 200 x ( ( 1 + 6%) ³⁰ - 1) / 6%= $15,811.64 Winston


 would have $15,811.64 

Explanation:

math is proof

3 0
2 years ago
What microphone is this
nadezda [96]

Answer:

Thats looks like a Sennheiser Pro Audio Wireless Microphone System, Black (MKE600) .  also known as Sennheiser MKE 600

Where you can get it:

https://www.amazon.com/Sennheiser-MKE600-Camcorder-Shotgun-Microphone/dp/B00B0YPAYQ

Youre welcome. (pls give brainlest thanks)

4 0
3 years ago
Which spreadsheet toolbar displays options such as Cut and Paste?
Lilit [14]
The answer would be ''Drawing Toolbar'' and you can find this inside your mouse area, where u click the right button (right side) and it shows a small chart/toolbar where it gives you the options to copy, cut, paste and more.
6 0
3 years ago
Read 2 more answers
Write a Unix (Linux) find-like command (myFind) in Python3 where the function will return the full paths of all the files contai
Leno4ka [110]

Answer:

import os, sys, stat

from stat import *

command = 'find ' + sys.argv[1] + ' -name *' + sys.argv[2] + '*'

print(command)

totalFiles = os.popen(command).read()

totalFiles = totalFiles.split()

totalSize = 0

for line in totalFiles:

  statinfo = os.stat(line)

 

  if stat.S_ISREG(statinfo.st_mode):

      print(line, statinfo.st_size, 'bytes')

      totalSize += statinfo.st_size

  else:

      print(line, '...')

print('Total file size:', totalSize, 'bytes')

Explanation:

  • According to command line arguments, build the find command.
  • Store the product by executing the command.
  • Loop through all files in the output list using the for loop.
  • Display the file name and size, If the file is regular otherwise just display the file name.
5 0
3 years ago
Other questions:
  • Which signal types are represented by a continuous wave form?
    11·1 answer
  • What are some of the academic benefits of a later start time that Jordan mentions​
    12·1 answer
  • You open a link in a new tab by holding the _______ button while clicking the link
    8·1 answer
  • Which organization has published more than 300 web standards
    7·1 answer
  • 4. What is the simplest way to permanently get rid of an unwanted file?
    12·1 answer
  • What does the noise reduction tool do?
    11·1 answer
  • Will created an entry in his calendar and marks it as an all day instance which item has he created
    9·1 answer
  • How do you print "Hello World" in the console with Python? Wrong Answers Only.
    7·2 answers
  • Why can i go to discord if my school blocks it-
    9·1 answer
  • Will give BRAINLIEST, PLEASE HELP, WILL BE MUCH APPRECIATED
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!