C Language ( Please dont give me code for C++. I want the code for C) Runners ha
ID: 3637392 • Letter: C
Question
C Language ( Please dont give me code for C++. I want the code for C)Runners have entered the mile race at the Penn Relays. Write
a program that scans in the race time in minutes and seconds for a
runner and computes and displays the speed in feet per seconds (fps)
and in meters per second (mps).
(Hints: There are 5,280 feet in one mile, and one kilometer equals
3,282 feet.)
Remarks: Please replicate the exact text of the prompts and the
output. Make sure that the answer is printed with two digit precision
(i.e., "%.2f" in printf). Even though the text must be the same, the
numbers may be different depending on the user input.
============= START OF SAMPLE RUN =======================
Enter the race time below.
Minutes: 3
Seconds: 52.83
The speed was 22.68 feet per second or 6.91 meters per second.
============= END OF SAMPLE RUN =======================
Explanation / Answer
Put this in the editor and run it. I think the same run is wrong though, For the time of 3 mins and 52.83 seconds should be around 14m/s not 6.91 #include void main(void){ float min; float sec; float time; float feet; float meter; printf("Enter the race time below "); printf("Minutes: "); scanf("%f",&min); printf("Seconds: "); scanf("%f",&sec); time=60*min+sec; feet=5280/time; meter=3282/time; printf("The speed was %.2f feet per second or %.2f meters per second ",feet,meter); }Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.