Computing.Net > Forums > Programming > Homework HELP with C++...I'm just not getting

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Homework HELP with C++...I'm just not getting

Reply to Message Icon

Name: amm28
Date: September 30, 2009 at 14:26:37 Pacific
OS: Windows XP
Product: Microsoft Visual studio v6.0 enterprise edition
Subcategory: C/C++
Comment:

I'm having a lot of difficulty with this homework problem...If anyone could show me how to do it that would be great!

Problem 1:
A liter is 0.264179 gallons. Write a program that will read in the number of liters of gasoline consumed by the user's car and the number of miles per gallon the car delivered. Your program should allow the user to repeat this calculation as often as the user wishes. Define a function to compute the number of miles per gallon. Your program should use a globally defined constant for the number of liters per gallon.
After doing this...
Modify your program so that it will take input data for two cars and output the number of miles per gallon delivered by each car. Your program will also announce which car has the best fuel efficiency (highest number of miles per gallon).



Sponsored Link
Ads by Google

Response Number 1
Name: Mechanix2Go
Date: September 30, 2009 at 15:02:33 Pacific
Reply:

Start with pseudo-cade. Like it says, you need a constant for the number of liters per gallon.

You need a couple variables: liters & miles per gallon.


=====================================
Helping others achieve escape felicity

M2


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Homework HELP with C++...I'm just not getting

need help with c homework www.computing.net/answers/programming/need-help-with-c-homework/4670.html

Rounding up decimals in C? www.computing.net/answers/programming/rounding-up-decimals-in-c/7181.html

Need Help With C++ cin command www.computing.net/answers/programming/need-help-with-c-cin-command/12174.html