Menu

Hello Need Help Program S C Please Don T Copy Paste Something Deals Classes Develop Class Q43815508

Hello, I need help with this program. It’s in C++. Please don’tjust copy and paste something. It deals with classes.

You are to develop a class call”statistic” that will do some simple statistical calculations. Theprogram will allow you to add new value(s) to a collection of dataand then be able to print out information about the data. Forexample, how many values are in the set of data (length), theaverage for the set of data, the largest, smallest values, and thesum of values? You will NOT need to save the individual elements ofthe data collection, just the values indicated.

Your main program will need to be ableto declare an object (ex stat) and then add data elements to thisobject. For example you may add new values “stat.add( 5.5)”, then”stat.add(6.6)” and so on. The class object “stat” will accumulatea sum, count the new element, determine if this is a larger value,and determine if new value is a smaller value. (Again, you will notsave the individual elements.) You will then be asking to print outinformation about the statistical object (number of values,average, smallest value in collection, largest value, and thesum.

Methods needed for the “statistic”are: add, getlength, getsum, getaverage, getlargest, getsmallest,initstat.

      The methods should be self explanatory.   “initstat” willset a statistical object to zero so as to accumulate a newcollection.

Use the following input to test yourprogram.

Data forstatistician1:   5.5, 6.6, 8.8, -3.4,-0.5, 4.7, 9.1

                               Print out: the Sum, length and average

                               add to statistician1: 5.2 – 3.3 – 8.5 3.2 5.5

                               

                               Print out: the Average, the smallest and largest values

Data forstatistician2:   empty

                                                               

                               Print out: the Sum, length and average

                               

                               add to statistician2: 103 821 871 487 312 245 224623 424 432

                               Print out: the Sum, length and average

Erasestatistician2:

                               Print out statistician2.

Data forStatistician2:  

                               Add to Statistician2:   9.3 -6.3 8.2 7.2 8.2 8.8 7.2 -3.27.6 9.3

                               Print out: the Sum, length and average

                               

                               Print out: the Average and the range of values: ie the smallest andlargest values

Expert Answer


Answer to Hello, I need help with this program. It’s in C++. Please don’t just copy and paste something. It deals with classes. Yo…

OR