March Programming Challenge I know. It's only February 24. But March is coming and I know you're itching to get started. So ... Write a computer program in C that uses the input data shown below and outputs the values described below. You may hardcode the pace values or (extra credit) put them in a file and read the file. This should be a good exercise for all those members who have joined in the last year or so who want to learn how to program in C. Please give this a go. One of the challenges that comes to mind is how the heck do you add paces that are in mm:ss (minutes and seconds) per mile. Have fun. Ask for help. Only way to learn is to do. input mile pace (minutes per mile) 0.0 21:52 .1 19:50 .2 17:26 .3 11:46 .4 18:57 .5 17:45 .6 18:55 .7 18:34 .8 16:40 .9 16:23 1.0 19:25 .1 18:39 .2 19:56 .3 19:11 .4 13:08 .5 17:22 .6 15:46 .7 11:50 .8 11:14 .9 9:28 2.0 19:42 .1 18:37 .2 8:39 .3 8:43 .4 7:54 .5 19:54 .6 20:41 .7 7:46 .8 7:46 .9 19:07 3.0 17:14 .1 19:23 .2 20:23 .3 17:59 .4 19:02 .5 19:30 .6 16:58 .7 18:27 .8 22:39 .9 18:52 4.0 18:55 .1 20:28 .2 19:25 .3 17:37 .4 19:17 .5 19:14 output 1. average pace for entire 4.5 mile jog (in minutes per mile) (add all 45 paces and divide by 45) 2. fastest pace during entire 4.5 mile jog (smallest minutes per mile) 3. fastest average pace during a .1 mile stretch (take two neighboring paces, e.g. one at 2.3 mile mark, the next at 2.4 mile mark, add them and divide by 2.) 4. fastest average pace during a .2 mile stretch (take three neighboring paces, e.g. one at 3.1 mile mark, the next at 3.2 mile mark, the next at 3.3 mile mark, add them and divide by 3.) 5. slowest pace during entire 4.5 mile jog (biggest minutes per mile) 6. slowest average pace during a .1 mile stretch (take two neighboring paces, e.g. one at 2.3 mile mark, the next at 2.4 mile mark, add them and divide by 2.) 7. slowest average pace during a .2 mile stretch (take three neighboring paces, e.g. one at 3.1 mile mark, the next at 3.2 mile mark, the next at 3.3 mile mark, add them and divide by 3.) Note: The above date was mined from an actual run. Paces at 0.0 mile mark, 0.1 mile mark, ... , 4.4 mile mark and 4.5 mile mark were recorded. |