Five students in college ; Mike, Abby, James, Anne, and Ali are preparing for an upcoming running competition organized by Sports Development Center in UOL. At every alternate day. They practice running in a football stadium for a certain distance and write down their time and distance covered. At the end of the week, they would like to know the number of meters runs each day, the total distance for each week, the total time they achieved as well as the furthest distance achieved. Write a c++ program that reads the data recorded by the five runners that contain the following: An array to store the names of the five runners and a two-dimensional array of five rows and eight columns of type double to store the distance and time for each runner. A function named read_data() to read data from the user and display the runner’s names and the distance (in meters) covered and the time achieved each working day. Runner’s name should be stored in a one-dimensional array of type string A function to find the total meters and time covered by each runner and the furthest distance achieved at the end of the week. The data is given to you as shown below. The data is read in sequence as follows; first input is the name of the runner, the second, fourth, sixth and the eighth columns are distance covered (in meter, e.g, 1000). The third, fifth, seventh, and ninth columns are the time taken (in second, e.g., 90) for each distance. Sample Input: Mike 1200 90 1700 150 2700 270 1200 120 Abby 1500 180 2800 340 1900 220 1100 90 James 2000 260 1800 200 1000 120 1600 210 Anne 1700 200 1500 180 2100 250 2500 300 Ali 1800 220 2400 300 1600 220 2100 210 Sample Output: Runner Distance Time Distance Time Distance Time Distance Time ------------------------------------------------------------------------------------------------------------------------------------- Mike 1200 90 1700 150 2700 270 1200 120 Abby 1500 180 2800 340 1900 220 1100 90 James 2000 260 1800 200 1000 120 1600 210 Anne 1700 200 1500 180 2100 250 2500 300 Ali 1800 220 2400 300 1600 220 2100 210 Runner Total Distance Total Time Furthest Distance -------------------------------------------------------------------------------------------------------------- Mike 6800 630 2700 Abby 7300 830 2800 James 6400 790 2000 Anne 7800 930 2500 Ali 7900 950 2400
Five students in college ; Mike, Abby, James, Anne, and Ali are preparing for an upcoming running competition organized by Sports Development Center in UOL. At every alternate day. They practice running in a football stadium for a certain distance and write down their time and distance covered. At the end of the week, they would like to know the number of meters runs each day, the total distance for each week, the total time they achieved as well as the furthest distance achieved. Write a c++ program that reads the data recorded by the five runners that contain the following:
- An array to store the names of the five runners and a two-dimensional array of five rows and eight columns of type double to store the distance and time for each runner.
- A function named read_data() to read data from the user and display the runner’s names and the distance (in meters) covered and the time achieved each working day. Runner’s name should be stored in a one-dimensional array of type string
- A function to find the total meters and time covered by each runner and the furthest distance achieved at the end of the week.
The data is given to you as shown below. The data is read in sequence as follows; first input is the name of the runner, the second, fourth, sixth and the eighth columns are distance covered (in meter, e.g, 1000). The third, fifth, seventh, and ninth columns are the time taken (in second, e.g., 90) for each distance.
Sample Input:
Mike 1200 90 1700 150 2700 270 1200 120
Abby 1500 180 2800 340 1900 220 1100 90
James 2000 260 1800 200 1000 120 1600 210
Anne 1700 200 1500 180 2100 250 2500 300
Ali 1800 220 2400 300 1600 220 2100 210
Sample Output:
Runner Distance Time Distance Time Distance Time Distance Time
-------------------------------------------------------------------------------------------------------------------------------------
Mike 1200 90 1700 150 2700 270 1200 120
Abby 1500 180 2800 340 1900 220 1100 90
James 2000 260 1800 200 1000 120 1600 210
Anne 1700 200 1500 180 2100 250 2500 300
Ali 1800 220 2400 300 1600 220 2100 210
Runner Total Distance Total Time Furthest Distance
--------------------------------------------------------------------------------------------------------------
Mike 6800 630 2700
Abby 7300 830 2800
James 6400 790 2000
Anne 7800 930 2500
Ali 7900 950 2400
Step by step
Solved in 2 steps with 4 images