Homework help!

Write a program that asks the user to input
•The number of gallons of gas in the tank
•The fuel efficiency in miles per gallon
•The price of gas per gallon
Then print the cost per 100 miles and how far the car can go with the gas in the tank.

My question is what does fuel efficiency in miles per gallon mean?
Please do not show me the answer.
Just need extra explanation.

My question is what does fuel efficiency in miles per gallon mean?

It means how many miles your car can go by consuming 1 gallon of gas.

If you can go 25 miles per gallon, it means you can go 100 miles per 4 gallons.

25 miles      4 gallons       100 miles
_________ *   _________   =  __________
1 gallon       tank            tank 

Last edited on
Remember that 25 miles per gallon means miles / gallons.
Thank Ganado.

It's that simple? Sometimes when it is so simple, I doubt myself.
Yep, just be sure to keep the units you convert "aligned" correctly.
e.g.

  x      y      x
 ___ *  ___  = ___
  y      z      z

Last edited on
Ganado I sent you a PM.
Topic archived. No new replies allowed.