Write a program that calculates the total cost of


Write a program that calculates the total cost of gasoline.
The going rate of gas is $3.40 per gallon.
Prompt the user to enter the (1) number of gallons they wish to purchase, and
(2) the number of gallons required to fill the tank. You must make sure that the number of gallons requested does not exceed the number of gallons required to fill up the tank, and is greater than zero (use an if statement). The program should output this statement: "It will cost x dollars to fill up n gallons of gasoline at $3.40 per gallon."

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Write a program that calculates the total cost of
Reference No:- TGS0646761

Expected delivery within 24 Hours