1. Engineering
  2. Computer Science
  3. i implement a container class stat that is a subelass...

Question: i implement a container class stat that is a subelass...

Question details

I. Implement a container class Stat that is a subelass of object. The class stores a sequence of numbers and provides statistical information about the numbers. It overloaded constructor that initializes the container either using a list or with no parameter which creates an empty sequence. The class also includes the methods necessary to provide the following behaviors: supports an >>> s-Stat() 0.0 >>> ฮ.max () o.0 >>.au >>> o.0 mean () .add (3) .add( tour) Eour not added. Value must be a number s.add (4) s.add(Five Five not added.Value auat be a nunber. >>>s.min >>>.max) >>> ธ.sun() 12 .mean () 4.0 >s.eleer Stat object with 0 cems >>>sl StAc(10,20,301) >>> al.mean ) 20.0 >>>i.max) 30
s1.max 0 This class also implements the operator ( the same. Example: eq ). It returns true if the SUM of the values is >>> slmStat ( [1, 2, 3] ) >>>s2 Stat ([3/2.11) True >> $2- Stat ((3,2,21) False Note that part of the exercise is to determine which methods you need to implement in orderN shown above. Ask the lab assistant if you get stuck on any of to obtain the the methods. Look the behaviors above carefully. Notice what happens if you try to add a value that is not a number
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution