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
Pachacha [2.7K]
3 years ago
11

Write a program that asks the user to input

Computers and Technology
1 answer:
Savatey [412]3 years ago
5 0

Answer:

import java.util.Scanner;

public class ANot {

   public static void main(String[] args) {

Scanner input = new Scanner(System.in);

       System.out.println("Please Enter the number of fuel gallons in the car's tank: ");

       int numGallons = input.nextInt();

       System.out.print("What is the fuel efficiency of your car in miles/gallon ");

       double fuelEffi = input.nextDouble();

       System.out.print("How much is the price per gallon: ");

       double price = input.nextDouble();

       double milesCanGo = fuelEffi*numGallons;

       double numOfGallons100Miles = 100/fuelEffi;

       System.out.println("The cost per 100 miles is "+numOfGallons100Miles*price);

       System.out.println("Your car can go as far as "+milesCanGo+" miles with the current fuel " +

               "in your tank");

   }

}

Explanation:

Using Java programming language;

  1. Import the Scanner class to receive user input
  2. Prompt user to input numofGallons, fuelEfficiency and pricePerGallon
  3. Calculate the miles the car can go with the formula milesCanGo = numofGallons X fuelEfficiency
  4. Calculate the number of gallons for 100 miles distance (100/fuelEfficiency)
  5. The cost of driving 100 miles is (100/fuelEfficiency)*pricePerGallon
  6. Output cost for 100 miles and how far the car can go.
You might be interested in
When a company is attempting to go public, they will hire an investment bank to...
schepotkina [342]

The correct answer is to provide underwriting services.

When a company is attempting to go public, they will hire an investment bank to provide underwriting services. The investment bank serves at the intermediary between the company and the investors.

6 0
3 years ago
Read 2 more answers
The air in the atmosphere circulates mainly because _____.
sesenic [268]
The answer is <span>convection is redistributing heat.  Convection as warm air goes up and once it is cooled it goes back down again.  Cool air is more heavy than warm air because it is more dense.  Its particles are more closer together than warm air.</span>
3 0
3 years ago
Read 2 more answers
Match the following Microsoft Windows 7 ​
Dominik [7]

Answer:

Explanation:  will be still function but Microsoft will no longer provide the following: Technical support for any issues

6 0
3 years ago
<img src="https://tex.z-dn.net/?f=%20%5C%3A%20" id="TexFormula1" title=" \: " alt=" \: " align="absmiddle" class="latex-formula"
Effectus [21]

Answer:

\tt \green{The \: elements }  \: of \:  \red{computer }  \: \blue{are:}

•Hardware

•Software

•Data

•Procedures

•Input Unit

•Output Unit

•CPU(Central Processing Unit)

•Connectivity

•Primary Memory

•Motherboard

•GPU(Graphics Processing Unit)

•Solid State Drive (SSD) or Hard Disk Drive (HDD)

•RAM

Explanation:

\tt \pink{HeavenMistress}

5 0
2 years ago
Read 2 more answers
A thesaurus is an example of a(n)
Ivahew [28]

Answer:

D. online reference

Explanation:

An "online reference" refers to a<em> digital reference</em> that end users may utilize for their work or other daily activities. For example, if a person is looking for the <em>synonym of a particular word,</em> she may then refer to the thesaurus.

A blog is a website where you can find personal journals from different writers.

An e-book is an <em>"electronic book."</em> This allows people to read book digitally.

An e-zine is an<em> "electronic magazine." </em>This is a magazine in its digital form.

3 0
3 years ago
Read 2 more answers
Other questions:
  • the task is to ask the user for three numbers and find the average which pseudocode gives you the comment outline for task​
    10·1 answer
  • Based on the relational model, create the database metadata as part the physical designphase.b)from the metadata, write the sql
    10·1 answer
  • To create a default value for a parameter in the parameter list of a function, you code a/an ________________ sign after the par
    5·1 answer
  • Who gave a demonstration of modern computer systems showing a mouse and when?
    8·1 answer
  • ShellShock had the potential for an unauthorized user to gain access to a server. It affected many internet-facing services, whi
    11·1 answer
  • Complete the statement below with the correct term.
    12·2 answers
  • What is the outside of an iPhone called?
    9·2 answers
  • Which function in Excel tells how many
    6·1 answer
  • What was Bill Gates purpose for starting a business?
    12·1 answer
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!