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
Give reasons why you care for your sense organs​
Cerrena [4.2K]

HI!the resaon why should you care for you sense organs is that they help us to contact with our surroundings.

8 0
1 year ago
Read 2 more answers
Suppose variables roll1 = 3 and roll2 = 4, which of the following will be evaluated as true?
Y_Kistochka [10]

Answer:

The correct answer for the given question is "  roll1>3 || roll2 > 3  "

Explanation:

In option A, there are two conditions separated by OR. In OR, if any condition  is true then it will return TRUE. There second condition is TRUE in the statement  that is why the whole expression return TRUE.

Thats why the correct answer is "roll1>3 || roll2 > 3".

5 0
3 years ago
50 POINTS!!!!! The managing director of a company sends a christmas greetings to all his employees through the company email. wh
seropon [69]

He uses an Enterprise International Private Network.

An Enterprise Internal Private Network is a type of network that is designed for private communication within an organization. The network could span multiple buildings using private communication lines.

Let me know if you have any questions.

6 0
2 years ago
HELP ASAP
ozzi

Answer:

a new rule

Explanation:

Sending meeting invitations, updates and receiving responses generates many messages.

And for this reason we create a rule that filters all meeting related messages to a specific folder and handles a large number of meeting responses.

8 0
3 years ago
Read 2 more answers
Create a function called full_name. Pass two parameters to the function, an employee’s last name and first name. The function sh
marissa [1.9K]

Answer:

The solution code is written in Python:

  1. def full_name(lastName, firstName):
  2.    return lastName + ", " + firstName  

Explanation:

Firstly, create a function and name it as<em> full_name</em> that takes two parameters, <em>lastName</em> and <em>firstName </em>(Line 1).

In the function body, we can simply use plus operator, "+", to join the <em>lastName</em> string, comma and <em>firstName</em> string into a concatenated string. Please note a single space is made right after the comma (Line 2).

At last, return the concatenated string as function output.

6 0
3 years ago
Other questions:
  • An employee is angry with his boss and wants to sabotage the company. To accomplish this he secretly changes some of the values
    7·1 answer
  • Read at least three (3) academically reviewed articles on Management Information Systems and complete the following activities:
    5·1 answer
  • Which of these is a primary and secondary source of market research, respectively?
    8·2 answers
  • A computer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a ser
    9·1 answer
  • If a tire fails or you have a blowout you should immediately concentrate your attention on
    6·2 answers
  • A unique ability of people which sets them far apart from animals is:
    8·1 answer
  • 1. Briefly explain the concept of signature of a function, in a function declaration. What signature components are crucial for
    9·1 answer
  • 2.
    8·1 answer
  • 9. h=
    6·1 answer
  • Henry wants to use handheld computers to take customers' orders in her restaurant. He is thinking of using custom written, open
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!