Question: 3. Gas Write a program that computes and displays the price a person will pay for gas at the gas station. If the person pays

3. Gas Write a program that computes and displays the price a person will pay for gas at the gas station. If the person pays with a credit card, there is an extra charge of 10% of the total price. Write yourcode in a file called Gas.java, yourclass must have this exact name with the letterG capitalized You must use the IO module to read inputs and to output your answer If you detect an error use the IO module to report bad input: lO.reportBadinputo Example 1 $ java Gas Enter cost of gallon of gas: 3. 40 Enter number of sal1ons: 15. 0 Is customer paying with a credit card? true RESULT: 56.1 Example 2 java Gas Enter cost of gallon of gas: 3. 40 Enter number of gallons: -15. 0 Is customer paying with a credit card? false User entered bad input
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
