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
Match each vocabulary word to its definition.
Nana76 [90]

Answer:

Column matching given in explanation

1. Intranet :  <em>a network of computer within an organization</em>

2. Placeholder: <em>an empty area that reserves space for new content</em>

3. Presentation: <em>information delivered to an  audience</em>

4: Presentation Technology:  <em>a software application that helps  organize and convey information</em>

5. Keynote:   <em>the main speech delivered to all in attendance</em>

Explanation:

Intranet:

A small network that exist in the small organization or company to connect all the computers in organization.

Placeholder:

In computer programming, few variables has been defined in the start of program. These variables have no value initially but can be utilized at the time of need. These variable holds some space in memory that is called Placeholder.

Presentation:

A piece of information relevant to some particular topic, which will be delivered to a particular audience is called presentation.

Presentation Technology:

The tools that are used to assist presentation such as projector, slides, boards etc. are called presentation technology.

Keynote:

The main idea of speech that presenter want to deliver to the audience is called Keynote.

4 0
2 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
Which formula is a simple formula?<br> O =E10/5+1<br> 0 -5+A1*B1<br> O =C3+10-E3<br> 0 =10-(A3-D13)
steposvetlana [31]

Answer:

O =C3+10-E3

Explanation:

Only addition and subtraction :D

8 0
2 years ago
Describe your microsoft word skills that need to be improved upon the most.<br><br>​
Ilya [14]
Shortcuts & Formatting Tricks
Mail Merge
Table of Contents
Compare Documents
Track Changes
Using Synonyms
Presenting Tabular data
Managing Header & Footer
Adding Pictures at right position
Automating tasks through Macros
572 viewsView 4 Upvoters
Related Questions (More Answers Below)
5 0
3 years ago
If you know batch coding, can you see if there is anything wrong with this script, or if you can make any suggestions to modify
zzz [600]
There isn't an opening and closing parentheses for the else statement. PM me. I know a lot of batch...
8 0
3 years ago
Other questions:
  • Cyber security includes which of the following?
    7·1 answer
  • It takes you 0.8 of a minute to read each page of your health book. It takes you 5.5 minutes to take the test at the end. How lo
    10·2 answers
  • Which of the following correctly describes the function of an IP address?
    7·1 answer
  • The World Wide Web (WWW) is a network of links on the Internet to documents containing text, graphics, video, and sound, but doe
    10·1 answer
  • Which resource helps a user access a cloud service?
    8·1 answer
  • How to make logo black and white in paint?
    14·1 answer
  • What does it mean when system ui has stopped?
    9·1 answer
  • Explain each kind of pointer and for what it is appropriate.
    8·2 answers
  • The Marketing Department for CSM Tech Publishing is busy producing videos and print materials (stored in PDF format) for distrib
    6·1 answer
  • Examples of domain names and usernames<br><br><br><br>​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!