Friday, August 12, 2011

Write an algorithm for commute?

I need to write an algorithm to find which commute is cheaper. I need to know should i take a my car or train to work. I know the one-way distance from my home to work and the MPG my car gets. I also know the one way price of a train ticket. I ume the cost per gallon is $4, and car maintenance is 5 cents per mile. Given this info which commute is cheaper??? Thanks for help!!

No comments:

Post a Comment