Question: Write a program that uses a class called Data, in Data.cpp . Yourprogram first asks a runner for a distance and 5 of his /

Write a program that uses a class called Data, in Data.cpp. Yourprogram first asks a runner for a distance and 5 of his/her best times in that event, andit will store the times in the array time. Then it finds the best, the worst, and the averagetime for that runner. Finally, it displays all five times, following by the worst, the best,and the average.The class Data has the following attributes, including an array of time, distance, min,max, and average.double time[N]; //array of times in secondint distance; //distance in meterdouble min, max, average;You need to write the function statistics. Please note that we assume we are onlydealing with N times (N is equal or greater than 5). So the statistics function is a simplefunction. This program finds the fastest time as the best time, the slowest time as theworst time, and computes the average of N times. Other functions including setTime(),setDistance(), and display() function to output the statistics functions results

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!