Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I need help writing a program?

Write a program that will calculate the average miles per gallon for a salesperson. The salesperson leaves his home every Monday and returns every Friday. He travels by company car. Each day on the road, the salesperson records the amount of gasoline put in the car. Given the starting odometer reading (that is, the odometer reading before he leaves on Monday) and the ending odometer reading (the odometer reading after he returns home on Friday), the program will find the average miles per gallon. The output of the program should include 1. starting odometer reading, 2. ending odometer reading, 3. total mileages, 4. Gasoline purchased on Monday, 5. Gasoline purchased on Tuesday, 6. Gasoline purchased on Wednesday, 7. Gasoline purchased on Thursday, 8. Gasoline purchased on Friday, 9. Total Gasoline purchased, and 10. average miles per gallon. All output data should be aligned by the decimal points.

Update:

A pseudo code would also help. Thanks

Update 2:

Win 32 in C++

6 Answers

Relevance
  • 1 decade ago
    Favorite Answer

    Hi,

    I can help you with the general program flow (which can be applied to any language :) )

    1) You need to get all the inputs required from the user

    ie. Start meter reading, ending meter reading, Gas for Monday - Friday.

    2) You have a few calculations to do, to get the output right

    ie. Total Mileage(no 3) = End reading(no 2) - start reading(no 1)

    Total Gas purchase (no 9) = Gas for Monday(no 4) + Tuesday(no 5) + Wednesday(no 6) + Thursday(no 7) + Friday(no 8).

    Average Miles per gallon(no 10) = Total mileage(no 3) / Total gas(no 9)

    3) Then you just need to output those calculations and the input back to the screen in the right order. (to get the output right, you will have to format the text or numbers to include the decimal points required - this varies from language to language)

    Hope this helps!

  • Anonymous
    4 years ago

    1

    Source(s): Help Your Baby to Read http://emuy.info/ChildrenLearningReading
  • 5 years ago

    If you have a challenge to helping your youngster that's trouble reading, no real matter what era she\he this system is what you need, Children Learning Reading from here https://tr.im/aP3S0 .

    Children Learning Reading is distinctive from other applications because it does not rely on teaching words by sight, a way that relies on kiddies recognizing and memorizing words by their material and structure. You may have observed (or also obtained!) classes that promote full term acceptance understanding, these classes usually require you to stay your son or daughter in front of a tv or computer monitor for an important period of time so as in order for them to learn phrases that will let them to start their studying journey.

    With Children Learning Reading your kid will just need to invest 5\15 minutes at day and he\she may learn to build the word making the complete process of understanding how to see much more effectively.

  • 5 years ago

    • A sales person leaves his home every Monday and returns every Friday. He travels by company car. Each day on the road the sales person records the amount of gasoline put into the car. Given the starting odometer reading (that is, the odometer reading before her leaves on Monday) and the ending odometer reading (the odometer reading after he returns on Friday), design an algorithm and computer program to find the average miles per gallon. (Take the gasoline unit as gallon)

  • How do you think about the answers? You can sign in to vote the answer.
  • 1 decade ago

    which language would you like it written in? do you want 16 bit, 32 bit or 64 bit? do you want it database compatible?

  • 1 decade ago

    Which programming language?

    =

    Show your code.

    -

    We will help make it work.

Still have questions? Get your answers by asking now.