Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Q 1 . ( 1 0 marks ) Write a program that uses a class called Data, in Data.cpp . Your program first asks a
Q marks Write a program that uses a class called Data, in Data.cpp Your program first asks a runner for a distance and of hisher best times in that event, and it will store the times in the array time. Then it finds the best, the worst, and the average time 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 timeN; array of times in second int distance; distance in meter double min, max, average; You need to write the function statistics. Please note that we assume we are only dealing with N times N is equal or greater than So the statistics function is a simple function. This program finds the fastest time as the best time, the slowest time as the worst 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
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