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
Bert started off his working life as a typesetter for a print house. With the advent of new technologies, Bert's job became redu
Inessa [10]

Answer:

Berth's job became redundant because she lacks the computing skills. Perhaps, she has been using manual or analog type writing machine to do her job and was doing it well but with the advent of computer that replaces analog type writer, she will become redundant.

Explanation:

She needs to learn how to use the computer to type and do her job efficiently in the print industry.

5 0
3 years ago
You are troubleshooting a computer that is in the design phase. The problem you see is that the CPU is not receiving information
iogann1982 [59]

Answer:

Control bus

Explanation:

A control bus is a PC bus that is utilized by the CPU to speak with gadgets that are contained inside the PC. This happens through physical associations, for example, links or printed circuits.

The CPU transmits an assortment of control sign to parts and gadgets to transmit control sign to the CPU utilizing the control bus. One of the principle targets of a transport is to limit the lines that are required for communication

An individual bus licenses communication between gadgets utilizing one information channel. The control transport is bidirectional and helps the CPU in synchronizing control sign to inside gadgets and outer segments. It is included interfere with lines, byte empower lines, read/compose sign and status lines.

8 0
3 years ago
Simone needs to add a query for multiple tables in her database. She is using Access 2016. Which tab should she use to add the q
pshichka [43]
Database tools should be the answer idrk
4 0
3 years ago
_______ refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when
ludmilkaskok [199]

Geofencing Marketing refers to the use of gps or rfid technology to create virtual boundaries that enable software to trigger a response when a mobile device enters or leaves a particular area.

<h3>What is Geofencing Marketing?</h3>
  • Geofencing marketing is an illustration of a real-time location-based trade tactic that utilizes geolocation data to mark users within a specified geographic region and delivers a range based on where they are or in what areas they have previously visited.
  • Geofencing marketing concerns setting up virtual borders around a point or area that tracks whenever someone with a portable device crosses them.

To learn more about Geofencing Marketing, refer:

brainly.com/question/9795929

#SPJ4

4 0
1 year ago
How to scan documents from printer to computer?
Romashka-Z-Leto [24]
The printer should have a control panel. Then you gotta touch Computer to scan to the computer that is connected. Then, touch the name of the computer that you would like to save the scan to. Lastly, touch<span> the scan-to type that corresponds to the document or photo you are scanning.

(By the way, anytime I said 'touch' it meant touch on control panel I believe)

Hope O helped and I apologize if it did not because I own a Mac with no printer. :)</span>
3 0
3 years ago
Other questions:
  • Swapping two numbers
    10·1 answer
  • The isometric projection camera technique provides an illusion of perspective by using things like parallax scrolling to create
    10·1 answer
  • (01.03 LC)
    9·1 answer
  • What is one of the most helpful things about having a role model?
    10·2 answers
  • One of the most common uses of spreadsheet are
    8·1 answer
  • Sara Beth and Taylor have developed a new software that they plan to distribute for free, allowing other software professionals
    7·1 answer
  • I made Pico with a Ray Gun (Next is Dad/Tankman)<br><br> Opinons?
    11·2 answers
  • Which type of measurement would you use to determine the mass of sugar?
    12·1 answer
  • How can you protect your information when using wireless technology
    10·1 answer
  • Which of the following is NOT a best practice to protect data on your mobile computing device?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!