Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And Relational Theory Normal Forms And All That Jazz

Authors: Chris Date

1st Edition

1449328016, 978-1449328016

More Books

Students also viewed these Databases questions

Question

Question What integration level should an employer choose?

Answered: 1 week ago