Write a program Gas.java that computes and displays the price a person will pay for gas at the gas station. The program takes three 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.

Answers

Answer 1

Answer:

double price, number, total;

boolean payment;

Scanner input = new Scanner(System.in);

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

price = input.nextDouble();

I've added the full source file as an attachment.

Where I used comments to explain difficult line

Explanation:


Related Questions

Changing the position of the wing will

Answers

Answer:

will cause error in your pc many many many

Answer:

change the center of gravity and neutral point

Explanation:

Someone copied a library video and sold the copies to friends. This is an
example of

Answers

Answer:

Intellectual Property Theft.

Explanation:

Intellectual property theft involves robbing people or companies of their ideas, inventions, and creative expressions—known as “intellectual property”—which can include everything from trade secrets and proprietary products and parts to movies, music, and software.

Answer:

cybercrime

both employees and outsiders

Aimless wandering

A security guard

Many security breaches ........

intellectual property theft

stealing ideas, information, or creative products

add a watermark

embezzling

divisions of a keyboard​

Answers

Answer:

There are 4 SECTORS!

Explanation:

Alphabetical (Word keys, main function keys), Numeric (Number keys. which is the number pad to your right), The function keys (Like Num. lock, and the F keys that go through F1 to F12), and the Cursor keys (Which is LITERALLY just the arrow keys) But if you were a gamer like me, you'd know that WASD is better for gamers.

Another mention: Control Keys ( Includes your Windows Icon, Left Ctrl, Alt, Fn(If it's there) Your Tab key, your Caps, Shift, and Right Ctrl.)

Find the value of 1/2 of 1/2​

Answers

Answer:

1/2 of 1/2​ is 1/4 or 0.25

Explanation:

Answer:

0.25 or 1/4

Explanation:

because 0.50 is 1/2 so half of 0.50 is 0.25 or 1/4

Look both _____before you cross a street and i want to see how much of yall know it

Answers

Answer:

Ways

Explanation:

Look both ways

What is the art of getting your work done through people in a harmonious way?
A.
having good interpersonal skills
B.
having good work ethics
C.
having high self-esteem
D.
having high work efficiency
E.
having conflict resolution skills

Answers

Answer:

A.

having good interpersonal skills

Answer:

it is (A)

Explanation:

What is the purpose of this diamond shape in a flowchart?

Answers

Answer:

To represent a decision making step.

Explanation:

for example, assume that you need to display 'pass' if the total marks are greater than 50 and 'fail' if it's less than 50

Then, after calculating the total, you should draw a diamond and inside it write, 'is total ∠ 50?'

after that you can continue your flowchart taking one decission as 'yes' and the other decission as 'no'

The rectangular shape stands for a task or course of activity. In the flowchart sequence, the diamond shape represents a question or a branch.

What is flowchart?

A flowchart is a diagram that shows a process' individual steps in their proper order.

It is a general tool that may be customised for a wide range of uses and used to define a variety of processes, including a project plan, an administrative or service process, or a manufacturing process.

These four typical forms are excellent for outlining organisational structure, how various departments interact, and economic, industrial, or administrative operations.

In a process, a decision point is represented by a diamond. Usually, the statement in the symbol will call for a "yes" or "no" response and, in accordance, branch to other locations in the flowchart.

Thus, this is the main use of diamond symbol in a flowchart.

For more details regarding a flowchart, visit:

https://brainly.com/question/14598590

#SPJ2

Xcode, Swift, and Appy Pie are all tools for doing what? A: Writing code in Java. B: Creating smartphone apps. C: Creating apps to run on a desktop or laptop. D: Writing code in C#​

Answers

Answer:

Creating smartphone apps

Explanation:

Took the test, got 100, read the lesson on slide 3 towards the bottom

write a letter to your friend telling him how computer has made learning easier to students

Answers

Answer:

Dear friend

How are you i am writing this letter to tell you how computer has made my learning easier to students.Computer is a great device to help in school work.Because it processes information and your school work,it evens help you to get done work easier and quicker.It dosent matter which coumpuer you use.Technology is a very useful source i hope you see it easier to use.I hope you enjoy what i write to you

Yours truly

Explanation:

i hope you enjoy my letter that i help you with message me

When writing a letter to your friend, it is important to:

State the reason you are writing to him.Let him know the specific ways the computer has made learning easier.Make some jokes and lighthearted comments.Promise to keep in touch.End the letter.

What is an Informal Letter?

This refers to the type of letter where a person writes to a friend or acquaintance and makes use of slangs and informal language.

Read more about informal letter here:
https://brainly.com/question/18879087

Myra Wrote a Program and forgot to put the steps in the correct order. Which step does Mya need to Review

A. Pattern Following
B. Planning
C. Segmenting
D. Sequencing

Answers

Answer:

B. Sequencing

Explanation:

I hope this helps you UwU

Answer:

The answer is 'A'

Explanation:

I took the test, and got a 100%

It also makes more sense than the other choices.

Have a good day <3

Which is the civil penalty for COPYRIGHTS violations? Choose the answer. $200-$150,000 fine up to five years in jail Fines and court costs 1 year in jail

Answers

Answer: $200-$150,000 fine

Explanation:

I took the Quiz

If String str = "United States";, then what is the value of str.indexOf("united");?

−1
0
1
2
3

Answers

Answer:

-1

Explanation:

due to the fact their is no capital "U" it will -1

Please Help Asap!

Fill in the blanks:

URLs are the global _____ of resources on the Internet.

URLs are to web browsers what postal addresses are
to ______.

URL structure is: Protocol + Domain Name + _______.

Answers

Answer:

addresses

envelopes

directory path

Explanation:

URLs are the global addresses of resources on the Internet. URLs are to web browsers what postal addresses are to envelopes. URL structure is: Protocol + Domain Name + directory path.

What is meant by URL link?

Just as homes and other buildings have a street address, websites have unique addresses to make it simpler for users to find them. On the Internet, these are referred to as URLs Uniform Resource Locators.

Most websites use "HTTP" or "HTTPS" to denote their protocol. This part of the URL is followed by a colon and two forward slashes, as in the example below: http://website.com. https://website.com.

Type: It gives information about the type of server where the file is kept. address: It provides the location or address of the internet server. The file's location on the internet server is indicated by the path.

Thus, addresses, envelopes and directory path.

For more information about URL link, click here:

https://brainly.com/question/23615920

#SPJ2

Which future US President attacked a French fort in the Ohio River Valley? A. John Adams B. George Washington C. Alexander Hamilton D. James Braddock

Answers

Answer:

George Washington

Explanation:

Plz help meeeeee QUICKLY!!! WORTH 15 POINTS!

Answers

Answer:

Im pretty sure Domain name system but dont trust me

Explanation:

What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();
}

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

}

}

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

}

}

A.
The interface should be declared as abstract.
B.
The class should be declared as abstract.
C.
The interface should have an implementation of method2.
D.
The class should have an implementation of method2.

Answers

Question: What is the issue with this code

interface Box2{

static final int ITEM_CODE=201;

int method1();

double method2();

public class Window implements Box2{

public int method1(){

return ITEM_CODE;

public class myFrame{

public static void main(String args[]){

Window w = new Window();

System.out.println(w.method1());

A. The interface should be declared as abstract.

B. The class should be declared as abstract.

C. The interface should have an implementation of method2.

D. The class should have an implementation of method2.

Answer: A The interface should be declared as abstract.

Describe in 2-4 sentences how you would select a function on a spreadsheet.

Answers

Answer:

Explanation:

You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

What is spreadsheet?

A spreadsheet is a type of computer program used for organizing, calculating, analyzing, and storing data in tabular form. Spreadsheets were created as digital counterparts to traditional paper accounting spreadsheets.

The data entered into a table's cells is what the program uses to run. Each cell may include text, numeric data, or formula results that automatically calculate and display values based on the contents of neighboring cells.

Users of spreadsheets can change any stored value and watch the changes in calculated values. This enables quick investigation of numerous scenarios without the need for manual recalculation, making the spreadsheet helpful for "what-if" study.

Therefore, You would call the capacity from the primary. At that point execute your own factors to it. When the capacity is in the cell, you can copy and after that paste it into another cell to do a similar capacity for that diverse scope of cells.

To learn more about Spreadsheet, refer to the link:

https://brainly.com/question/8284022

#SPJ3

What Information Technology is Walt Thomas responsible for?

Answers

Proactive designing i think

Answer:   employee productivity and activity management, selling the vast.

Explanation:

changing the layout of a document or the text is called....

Answers

The Answer is:

Formatting.

Poems are a kind of persuasive document
Yes or no?

Answers

Answer:

i believe the answer yes because the author wants the audience sympathetic attention.

Answer:False

Explanation:

Use the drop-down menus to complete the steps for using the Scenario command.


1. Select the cells you want to use in your scenario.


2. Go to the ____ tab.

Data
Home
Insert
Formulas

3. In the Forecast group, select _____ and click Scenario Manager.

Sort
Get Data
Forecast Sheet
What-If Analysis

4. Click Add and fill in the name and add comments if you wish.


5. To compare, you will want to create _____ version.

A what-If
A original
A Data Table

6. Add a second scenario, changing the values from the first.


7. Click _____ to view the values in each scenario.

OK
Show
Review

Answers

Answer:

1. Select the cells you want to use in your scenario.

2. Go to the Data tab.

3. In the Forecast group, select What-if Analysis and click Scenario Manager.

4. Click Add and fill in the name and add comments if you wish.

5. To compare, you will want to create an original version.

6. Add a second scenario, changing the values from the first.

7. Click show to view the values in each scenario.

I got the answer right on Edge :)

The cells a person want to use are:

Go to the Data tab. In the Forecast group, select What-if Analysis and click Scenario Manager.Click Add and fill in the name and add comments if you wish. To compare, you will want to create an original version.

What is cell?

A cell is known to be area that is found on a spreadsheet that is known to be the place where the data are said to be entered.

Note that in the case above, The cells a person want to use are:

Go to the Data tab. In the Forecast group, select What-if Analysis and click Scenario Manager.Click Add and fill in the name and add comments if you wish. To compare, you will want to create an original version

Learn more about cells from

https://brainly.com/question/13920046

#SPJ9

Dan works for an automobile company. He has designed a new model of a car based on an older version. Which technology can he use to present the model at a board meeting?
A.
wearable computing
B.
3-D printing
C.
grid computing
D.
screenless display

Answers

Answer:

a

Explanation:

i did the test

Answer:

The answer is B (3-D printing)

Explanation:

Unscramble the words

A: ESUOM RETUPOC

B: KSID EVIRD

Answers

A. Mouse coputer
B. Disk drive
A) Mouse copter
B) Disk Drive
hope this helps x

In what situations should you show enthusiasm at work? Check all of the boxes that apply.

when you are congratulated on a job well done

when you are offered a new project

when you know that gossip is occurring among colleagues

when you are running a team meeting

when you are offered a promotion

Answers

Answer: A, B, D, E

Explanation: edge 2022

how does air conditioner work
please short answer please​

Answers

It draws the warm/ hot air from inside to outside and the AC unit (usually outside) turns the vapor into a liquid which removes any excess heat. (This is the way I learned it)
The air conditioner in a central heating and cooling system provides cool air through ductwork inside your home, by providing a process that draws out the warm air inside, removing its heat.

He made me so angry when he didn’t let me make my point that I had to stalk after him.
a.
follow
c.
stem
b.
shoot
d.
branch

Answers

Answer: follow

Explanation:

Answer: A) follow

Explanation:

Often used in connection with a business
A: fair use
B: copy right
C: public domain
D: commercial use
E: Creative Commons

Answers

Answer:

I would have to say public domain (but i am not sure)

When would you use database software instead of spreadsheet or word processing software?​

Answers

Answer: When I need to see table relationships and sort data by custom fields.

Explanation:

Answer: When I need to see table relationships and sort data by custom fields.

Explanation: took the quiz

whats the answer to 9? i really need help with this in the next 20 minutes. ty if u help me!

Answers

Answer:

A very precise number B

Explanation:

Hope you pass

Workbook and worksheet are synonymous, where each workbook will contain only one worksheet

True or false

Answers

False a Brainiest would be appreciated if I’m right
This is a false statement
Other Questions
Use the information to diswerThe area of the triangle shown is 40.0 cm2.?12.5 cmWhat is the height of the triangle?A. 3.20 cmOB. 6.40 cmOC. 13.8 cmOD. 27.5 cm A store pays $122 for a tennis racquet. If the store marks the tennis racquet up 30%, how much are they selling the racquet for? Which formula is an ionic compound?A.NaFB.N2C.NO2D.CO2FIRST ACCUAL ANSWER GETS BRAINLIST :) Contrast in the context of visual design can be defined as a difference between two or more elements in acompositionTrue or false ? What are the two monetary benefits that can be gained from:a. buying a propertyb. buying shares? Previous government experience is a Constitutional requirement for President of the United States,TrueFalse HELPPP MEEEE ASAPPPP Identify the constant of proportionality in the equation belowY = 3x + 5Does k = ? Does k = 5? Does k = 3? Does k = 35? Hydrochloric acid and sodium hydroxide can be combined to form sodium chloride and water. Which best explains the reaction? The algebra teacher said if you square my age then subtract 23 times my age, the result is 50. How old is he? Subduction involves an oceanic plate moving beneath a continental plate.Question 8 options: True False simplify 6^7 over 6^5 leaving the answer in index form ASAP!!!!!True or False. Early French settlements were centered on farming and wealth. Can u please help I will do Brainleyist Each of 12 refrigerators of a certain type has been returned to a distributor because of an audible, highpitched, oscillating noise when the refrigerators are running. Suppose that 7 of these refrigerators have a defective compressor and the other 5 have less serious problems. If the refrigerators are examined in random order, let X be the number among the first 6 examined that have a defective compressor. What is the probability that X exceeds its mean valueby more than 1 standard deviation? It is important to keep the three parts of the health triangleSelect two responses.A. working togetherB. apartC. balancedD. working independently 1 If f(x) = x - x9, what is the value of f(2)?Can any1 help me with this question please Which element has four times as many protons in its nucleus than are found in Neon? please help!!!!!! I will mark brainliest!!! Thank all of you for helping me with my questions-/////- Of all the leadership skills you learned in this class, which one do you think is the hardest to apply