← Back

Code Challenge 1.10 - Fuel Calculator


Objective

Create a console application that prompts the user to input the distance they plan to travel, their vehicle’s miles per gallon (mpg), and the current price of gas per gallon. The program will then calculate and display the total amount of gas needed for the trip and the total cost.

Skills to Practice

Challenge Tasks

Sample Output

--- Fuel Calculator ---
How many miles are you traveling? 150
What is your vehicle's gas mileage (mpg)? 34
What is the current price of gas per gallon? $2.95

For your trip, you will need 4.4 gallons of gas costing $12.98 total.