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
DLucy is planning to launch her podcast on career guidance for college students and has already recorded a few videos for market
KIM [24]

Answer:

A. FilmoraGo; C. Adobe Premiere

Explanation:

Many video editing software exists out there, but their function is pretty much the same. They edit, mix and customize clips to create beautiful multimedia content for different purposes (advertisements, podcasts, movies, comedy clips, etc.). This software used are different as some may contain more functions and setting than the other.

Let us take a brief dive into the options:

  1. FilmoraGo: is a video editing software that runs on Andriod and iOS. It contains many effects and it is pretty basic to use and understand.
  2. Google Photos: Created by Google, helps to organize your photo albums and stores them for you.
  3. Adobe Premiere: is also a video editing software, it was first launched in 2003 and has since evolved to contain more sophisticated video editing tools.
  4. Audacity: is an audio editor available for Windows, Mac OS, and Linux. This software is completely free and open source.

Hence, dLucy can use the FilmoraGo or the Adobe Premiere to edit her video clips.

6 0
3 years ago
What is the full form of com​
nignag [31]

The answer is:

Commercial

3 0
3 years ago
How is photography like jazz music?
Wewaii [24]
LIke jazz, photography has fallings that are being implied to the pictures such as the jazz music. These felling or as there commonly know as soul can make great music and even HD pictures in photography.
7 0
3 years ago
Question 4 1 pts The following code could be rewritten using: if (x &gt; 12): if (x &lt; 34):​
artcher [175]

Answer:

if(x>12 || x<34)

Explanation:

Mashing the two together using the or '||' operator would allow to run both necessary functions for the next code.

7 0
2 years ago
What does Iamo mean? i keep on hearing it and idk what it means
k0ka [10]

Answer:

laughing my ars e off

Explanation:

AAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH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HHHHHHHHHHHHHHHHHHHHHHHHHH

6 0
2 years ago
Read 2 more answers
Other questions:
  • If you quote an author from a website in a paper, it will be important to create a _____ in your writing to give them credit for
    7·2 answers
  • When selecting current page from the print range, on the print dialong box it will print
    5·1 answer
  • Your network administrator finds a virus in the network software. Fortunately,
    13·1 answer
  • Which one of these tasks is part of the pre-production phase of game development?
    11·2 answers
  • Impaired drivers are one of the many risks drivers face on the Highway Transportation System. List 3 signs that a driver could b
    10·2 answers
  • Selma writes the following four answers in her Computer Science examination.
    8·2 answers
  • What is phishing?
    14·1 answer
  • Simplest way to start baking career is to attend_______.<br><br><br><br>​
    9·1 answer
  • What does Amara hope will<br> happen when Dad sits on the sofa?
    8·1 answer
  • What is a program that includes a function parameter capable of doing?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!