MPG Calculator

This is a discussion on MPG Calculator within the C++ Programming forums, part of the General Programming Boards category; I am a beginner in C++. I have already made the part to calculate the mpg, but it only does ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    2

    MPG Calculator

    I am a beginner in C++. I have already made the part to calculate the mpg, but it only does it once. I have many reciepts i want to calcualte in one go and i want the average mpg to show when i am done, what will i have to do?

  2. #2
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052
    what's "the mpg"? I have no idea what you're talking about...
    Please direct all complaints regarding this post to the nearest brick wall Have a nice day.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    2
    mpg is miles per gallon on a car

  4. #4
    Mayor of Awesometown Govtcheez's Avatar
    Join Date
    Aug 2001
    Location
    MI
    Posts
    8,825
    Use a loop to keep getting input, incrementing the number of inputs inputted, and keep a tally of total miles and total gallons. Then, just divide total miles by total gallons and you're done.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. GUI Calculator - Critique
    By The Brain in forum Windows Programming
    Replies: 1
    Last Post: 02-25-2006, 03:39 AM
  2. C++ Program Help (MPG calculator)
    By mrwooter in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2005, 01:46 PM
  3. Calculator + LinkedList
    By maro009 in forum C++ Programming
    Replies: 20
    Last Post: 05-17-2005, 12:56 PM
  4. Need help with calculator program
    By Kate in forum C# Programming
    Replies: 1
    Last Post: 01-16-2004, 09:48 AM
  5. Replies: 2
    Last Post: 05-10-2002, 04:16 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21