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
What makes Group Policy such a powerful tool is its ability to enable security administrators to:_________.
babunello [35]

Answer: Enforce the organization's security policy

Explanation: Group policy provides a robust and centralized control to systems or computers on a particular network by providing a quick and efficient means of maintaining network security by affording network administrators the ability to several policies they wish to apply on users and computers in their network. This way the changes or policies can be applied to every computer on it's network. Hence it allows the network administrators to enforce the organization's security policy which may include restricting access to certain websites, directories, files or settings for all computers on the organization's network.

5 0
3 years ago
Susan wants to play the games that come with Windows on her computer, but they are not on the Start menu. What should she do in
ollegr [7]

Answer:

Search for the games in the search bar

Explanation:

5 0
2 years ago
A circuit contains two 500 OHM resistors connected in parallel and is supplied with 60 VDC. What is the current in the circuit?
andreyandreev [35.5K]
Remember Ohm's law V=IR. Plugging in the information gives you 60=500\times I \\ \implies I=0.12 amperes of current.
5 0
3 years ago
Read 2 more answers
Henry is designing a document for his architecture project. In which order should Henry preform the different tasks that are req
nadezda [96]

It is

Select an appropriate layout

Decide which current format...

Import or compose...

Proofread...

Check the print preview..

4 0
3 years ago
What security weaknesses/vulnerabilities exist in Wireless local area network device hardware and software?
AfilCa [17]

Answer:

Explanation:

There are many weaknesses/vulnerabilities, some of which are the following...

Default Network Hardware, many individuals will go out and buy a new router and install it in their home. These devices come with a preset configuration including a preset security password which is many times a default password used for every router of the same model. This can be easily obtained by anyone who can then access the network.

Access Point hacking, an experienced individual can use a packet sniffer to detect the SSID that is frequently sent from the router in order to create an access point to be able to access the network.

WEP encryption is another vulnerability. These are very low security passwords that can be cracked using different software in a short period of time.

These are some of many vulnerabilities that wireless local networks have, but there are also many precautions and security measures that can be taken to prevent them.

7 0
3 years ago
Other questions:
  • A(n) ____________________ is a set of programs that coordinates all the activities among computer or mobile device hardware.
    10·1 answer
  • What describes the basic transaction data such as its date, purpose, and amount and includes cash receipts, canceled checks, inv
    13·1 answer
  • HI GIVING BRAINLIEST Tyra used the software development life cycle to create a new game. She released it to her friends in order
    14·2 answers
  • Explain why Windows and Linux implements multiple locking mechanisms. Describe the circumstances under which they use spinlocks,
    13·1 answer
  • Write a program in c++ that asks the user for a sequence of n​integers, where the user provides the number of elements n​ then e
    12·1 answer
  • Can you make copies of classified documents provided you alert others?
    6·1 answer
  • How can netiquette help you communicate when texting or instant messaging?
    6·1 answer
  • What is data? why is it important to collect data ? explain the points.​
    10·1 answer
  • What is a key differentiator of Conversational Artificial Intelligence (AI)
    11·1 answer
  • What is the official name of an application on a desktop or a laptop?.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!