Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can you make it in printf, scanf form? Thanks. 3. their distance run and speed. Write a C Program that will read in location data
Can you make it in printf, scanf form? Thanks.
3. their distance run and speed. Write a C Program that will read in location data for a runner, and then calculate the total distance run(in miles) and the pace that the runner ran that distance(in minutes per mile) Presume you work for a company that makes GPS watches for runners to track Create a new project in Visual Studio The data file is available for you in the assignment in Canvas Save the file in the project folder. (If you have trouble saving to the project, you may save to the h drive and include the directory in the filename in the fopen statement, making sure to use double slashes: "h:filename.txt".) . . . In the program check to make sure the file opened successfully. .Then write a program to read in the runner's position data using a for or while loop The data file contains the number of data points in the first line. Starting with line 2, the data file contains the x and y coordinates of the runner starting at t-0(starting location). Each subsequent set of coordinates is 4 seconds after the previous one. Use the following formula to determine between two points(xl, yl) and (x2, y2): e . distance - V(x2 - x1)-+ (y2 - y1) Note that units are significant in this problem. The x and y coordinates are in feet, so the distance calculation will also be in feet Use this formula for your pace: . total time total distance Data points are taken in intervals of 4 seconds. Pace should use the units of time per mile. You will need to convert the total number of seconds to minutes and seconds once you calculate your pace . Your output should use this format and be written to a second output datafile The runner ran x.xxxx miles At a pace of mm:ss per mile. Where mm is the number of minutes and ss is the numbers of seconds, Close the files at the end of the program. Submit the output datafile that you created with the .c fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started