Write a program that calculates the total cost of gasoline


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!!
Other Subject: Write a program that calculates the total cost of gasoline
Reference No:- TGS0615371

Expected delivery within 24 Hours