Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //By Philson Wong
- //track.c 14 Oct
- #include <stdio.h>
- #define fpm 5280
- #define fpk 3282
- void instruct();
- int main()
- {
- double mins, secs, fps, mps;
- instruct();
- printf("Minutes for the runner: "); //Prompt for the minutes
- scanf("%lf", &mins);
- printf("Seconds for the runner: "); //Prompt in seconds, lf
- scanf("%lf", &secs);
- fps = fpm / ((mins * 60) + secs);
- mps = fpm * 1000 / (fpk * (mins * 60 + secs)); //Equation is same as fps, except converted
- printf("That is %.1lf feet per second, and %.2lf meters per second.\n", fps, mps);
- return (0); //Return of integer expected
- }
- void instruct()
- {
- printf("This program will ask for the minutes and seconds for the time it\n");
- printf("took for a runner to run a mile. The program will then calculate\n");
- printf("the feet per second and meters per second for that runner.\n\n");
- //Acts as prompt, called by instruct(); in the main function
- }
Add Comment
Please, Sign In to add comment