run1206

March 28th, 2009, 06:56 PM

ok, Bodsda asked if I could come up with the next challenge, so here's challenge #2!

Challenge: Make a program (using any language desired) that will calculate the average miles per hour for a road trip.

The input will come from a file, the output can be either another file or standard terminal output. Your parameters will be...

1. Number of miles at the start of the trip.

2. Number of miles at the end of the trip.

3. Number of seconds of the total trip.

You could do more than three parameters but these three are the main parameters to use (start1, end1, time1, start2, end2, time2, etc...)

after the program receives the inputs, calculate the miles per hour. If you use more than one set of parameters, calculate the "cumulative" miles per hour. Figure out how to convert the seconds to hours for proper calculation.

Extra Credit: put the time in standard time format (11:30:00, 15:42:15, 23:59:59, etc...) and calculate timing of hours and minutes from there.

Try to make your implementation as clean and as clear as possible, readable by beginners. Any experts doing the coding, please help out any beginners having trouble with their code.

Should be fairly simple; i've done it in C++ but i'm curious how some other programs might do the procedure. Just remember to use File Input/Output when inputting the parameters. Good Luck!! :)

~run1206

Challenge: Make a program (using any language desired) that will calculate the average miles per hour for a road trip.

The input will come from a file, the output can be either another file or standard terminal output. Your parameters will be...

1. Number of miles at the start of the trip.

2. Number of miles at the end of the trip.

3. Number of seconds of the total trip.

You could do more than three parameters but these three are the main parameters to use (start1, end1, time1, start2, end2, time2, etc...)

after the program receives the inputs, calculate the miles per hour. If you use more than one set of parameters, calculate the "cumulative" miles per hour. Figure out how to convert the seconds to hours for proper calculation.

Extra Credit: put the time in standard time format (11:30:00, 15:42:15, 23:59:59, etc...) and calculate timing of hours and minutes from there.

Try to make your implementation as clean and as clear as possible, readable by beginners. Any experts doing the coding, please help out any beginners having trouble with their code.

Should be fairly simple; i've done it in C++ but i'm curious how some other programs might do the procedure. Just remember to use File Input/Output when inputting the parameters. Good Luck!! :)

~run1206