#### bouttreefiddy

##### New Coder

C:

```
#include <stdio.h>
//constants
#define FEET_PER_MILE 5280
#define METERS_PER_MILE 1609.34
//function protypes
int time_in_seconds(int minutes, int seconds);
double feet_per_second(int minutes, int seconds);
double meters_per_second(int minutes, int seconds);
int main(void)
{
int input_minutes, input_seconds, out_seconds;
double fps, mps;
printf("Enter Runner 1's time in minutes and seconds.\n");
scanf("%d" "%d", &input_minutes, &input_seconds); //get input
out_seconds = time_in_seconds(input_minutes, input_seconds); //call functions
fps = feet_per_second(out_seconds, FEET_PER_MILE);
mps = meters_per_second(out_seconds, METERS_PER_MILE);
printf("Runner 1 ran the mile in %d minutes and %d seconds at a speed of %.3lf feet per second, or %.3lf meters per second.\n\n", input_minutes, input_seconds, fps, mps); //display outputs
printf("Enter Runner 2's time in minutes and seconds.\n");
scanf("%d" "%d", &input_minutes, &input_seconds);
out_seconds = time_in_seconds(input_minutes, input_seconds);
fps = feet_per_second(out_seconds, FEET_PER_MILE);
mps = meters_per_second(out_seconds, METERS_PER_MILE);
printf("Runner 2 ran the mile in %d minutes and %d seconds at a speed of %.3lf feet per second, or %.3lf meters per second.\n\n", input_minutes, input_seconds, fps, mps);
printf("Enter Runner 3's time in minutes and seconds.\n");
scanf("%d" "%d", &input_minutes, &input_seconds);
out_seconds = time_in_seconds(input_minutes, input_seconds);
fps = feet_per_second(out_seconds, FEET_PER_MILE);
mps = meters_per_second(out_seconds, METERS_PER_MILE);
printf("Runner 3 ran the mile in %d minutes and %d seconds at a speed of %.3lf feet per second, or %.3lf meters per second.\n", input_minutes, input_seconds, fps, mps);
return 0;
}
//function definitions
//calculate total seconds
int time_in_seconds(int minutes, int seconds)
{
int calc_seconds;
calc_seconds = (minutes*60)+seconds;
return calc_seconds;
}
//calculate fps
double feet_per_second(int minutes, int seconds)
{
double calc_fps;
int calc_seconds;
calc_fps = (double)FEET_PER_MILE/calc_seconds;
return calc_fps;
}
//calculate mps
double meters_per_second(int minutes, int seconds)
{
double calc_mps;
int calc_seconds;
calc_mps = (double)METERS_PER_MILE/calc_seconds;
return calc_mps;
}
```