My final problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

My final problem

2nd May 2018, 4:58 PM
annouar
annouar - avatar
2 Answers
+ 3
So, what have you done so far? Where are you stuck?
2nd May 2018, 5:19 PM
Tashi N
Tashi N - avatar
- 1
A common programming task is computing statistics of a set of numbers. (A statistic is a number that summarizes some property of a set of data.) Common statistics include the mean (also known as the average) and the standard deviation (which tells how spread out the data is from the mean). Define a class called StatCalc that can be used to compute these statistics, as well as the sum of the items in the dataset and the number of items in the dataset. If calc is a variable of type StatCalc, then the following methods shall be defined: calc.enter(item); where item is a number, adds the item to the dataset; calc.getCount() is a function that returns the number of items that have been added to the dataset; calc.getSum() is a function that returns the sum of all the items that have been added to the dataset; calc.getMean() is a function that returns the average of all the items.; calc.getStandardDeviation() is a function that returns the standard deviation of the items.
2nd May 2018, 4:59 PM
annouar
annouar - avatar