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
Allushta [10]
3 years ago
12

Write a program Gas.java that computes and displays the price a person will pay for gas at the gas station. The program takes th

ree command-line arguments: two double arguments referring to the price per gallon, and the number of gallons of gas, and one boolean argument referring to whether the person pays cash or credit (true for cash, false for credit). If the person pays with a credit card, there is an extra charge of 10% of the total price. Gas is never free. A person stopping to buy gas will always buy some amount of gas. Print the error message "Illegal input" if any of the double inputs is zero or negative, and end the program.
Computers and Technology
1 answer:
Tems11 [23]3 years ago
5 0

Answer:

double price, number, total;

boolean payment;

Scanner input = new Scanner(System.in);

System.out.print("Enter Amount of Gas: ");

price = input.nextDouble();

<em>I've added the full source file as an attachment.</em>

<em>Where I used comments to explain difficult line</em>

<em />

Explanation:

Download java
You might be interested in
Which is the value that expressions within conditional statements return?
Norma-Jean [14]

Answer:

i think its B Int

Explanation:

i hope i helped you figure it out if not sorry i will try harder next time :3

5 0
3 years ago
Discuss FOUR challenges that have an impact on domestic tourism
shutvik [7]
Crime rate
unemployment
fluctuations
suspension of terrorism
5 0
4 years ago
How to build an arch bridge​
Shkiper50 [21]

get resources like nails and wood and a couple rolls of tape if anything goes wrong

3 0
4 years ago
In the context of intentional security threats, _____ can erase data and wreak havoc on computers and networks but do not replic
mihalych1998 [28]

Answer:

The answer is "Option D".

Explanation:

Trojan program is a malicious code that is also known as a virus. It is a rootkit, that aims to infect the computer to hide or obscure an object. These programs are mainly used to download additional content, such as additional pieces of malware, to the infected computer, and other options are wrong that can be defined as follows:

  • In option A, It is not correct, this option infects the system.
  • In option B, It is used for infects another computer that's why it is incorrect.
  • In option C, It is incorrect because it is used in cybersecurity.  
5 0
3 years ago
Now the y0utube home screen is gone
erik [133]

Answer:

oh no thanks not good

Explanation:

did you try it on a different device mabye a phone

7 0
3 years ago
Read 2 more answers
Other questions:
  • Your desktop computer monitor is not displaying a picture. What would you do to troubleshoot the problem?
    9·2 answers
  • What is basic function of an operating system?
    10·2 answers
  • To track website behavior data with google analytics, which steps will you need to complete?
    14·1 answer
  • Select the correct answer.
    15·1 answer
  • Which process refers to starting up a computer?
    13·2 answers
  • we studied FIFO, Priority, Round Robin (RR), and Weighted Fair Queueing (WFQ) packet scheduling disciplines. Which of these queu
    12·1 answer
  • A function ________ contains the statements that make up the function.
    5·1 answer
  • Consider a Rational class designed to represent rational numbers as a pair of ints, along with methods reduce (to reduce the rat
    10·1 answer
  • What is the location in the base interface of the link to
    7·1 answer
  • Study the following two class interfaces: class Question { public: Question(); void set_text(string new_text); void set_answer(s
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!