Homework help!

Jan 30, 2019 at 7:09pm
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.

Jan 30, 2019 at 7:15pm
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 Jan 30, 2019 at 7:19pm
Jan 30, 2019 at 7:19pm
Remember that 25 miles per gallon means miles / gallons.
Jan 30, 2019 at 7:19pm
Thank Ganado.

It's that simple? Sometimes when it is so simple, I doubt myself.
Jan 30, 2019 at 7:33pm
Yep, just be sure to keep the units you convert "aligned" correctly.
e.g.

  x      y      x
 ___ *  ___  = ___
  y      z      z

Last edited on Jan 30, 2019 at 7:34pm
Jan 30, 2019 at 8:04pm
Ganado I sent you a PM.
Topic archived. No new replies allowed.