Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

ronnie.villanueva, Please let somebody else answer the question. I can not get the result using your answer. Thanks! [4]: [5]: d) (20 Points) Define and

ronnie.villanueva, Please let somebody else answer the question. I can not get the result using your answer. Thanks!

image text in transcribedimage text in transcribed
[4]: [5]: d) (20 Points) Define and implement seperate methods as members of the Stat class to calculate the measures of central tendency and spread: meanStat, medianStat, modeStat, iqutat, stdevStat, varStat. Each measure returns only one numerical value and the quartiles can be computed by any of these methods. Consider the input values are unimodal i.e. there is only one mode. #INSERT YOUR ANSWER HERE e) (10 Points) An outlier is an unusual data element that might be caused by errors or incorrect data entry. Define and implement an outlierStat method as a member of the Stat class. The outlierStat method should return all the items outside the following range: [Q1 - 1-5(Q3 - Q1), Q3 +1-5(Q3 - Q1)] Forexample, if objStat = Stat( [5,3,7,3,6,4,5,8,2,9,3,4,20,10]) then the outlierStatmethodwill return {10, 20] #INSERT YOUR ANSWER HERE f) (10 Points) Define and implement a method named measuresStat as a member of the Stat class that returns all the central tendency and spread measures of any integers sequence. For example, if obj Stat = Stat( [5, 3, 7, 3, 6, 4, 5, 8, 2, 9, 3, 4, 20, 10]) then the measuresStat method will return the follwoing output: Measure Approximate Value Length 14.00 Minimum 40.00 Maxium 20.00 Average 4.93 Median 4.50 Define a class named Stat that can be instantiated with a list of integers. Note: Only Python built-in functions are allowed to be used in this question. Do not use a third-party library for any part of the code. Importing any third-party library will result in marks deduction.** a) (10 Points) Instantiate the Stat class with a constructor that accepts a list of integers. Each instantiated object should have two attributes: length and items . The length returns the number of elements of the object, and the items attribute returns the content of the list. For example, if objStat = Stat( [5, 3, 7, 3, 6, 4, 5, 8, 2, 9, 3, 4, 20, -10] ) then the length should be 14 and the items [5, 3, 7, 3, 6, 4, 5, 8, 2, 9, 3, 4, 20, -10] [1] : #INSERT YOUR ANSWER HERE b) (10 Points) Define and implement a mutator method named sortStat as a member of the Stat class. The sortStat method sorts the items attribute elements in ascending order. Use the insertion sort algorithm for this task. For example, if objStat = Stat( [5, 3, 7, 3, 6, 4, 5, 8, 2, 9, 3, 4, 20, -10] ) then after invoking the sortStat method, the items attribute will be [-10, 2, 3, 3, 3, 4, 4, 5, 5, 6, 7, 8, 9, 20] [2] : #INSERT YOUR ANSWER HERE c) (10 Points) Define and implement an accessor method named belongStat method as a member of the Stat class. The belongStat method accepts an integer and returns True if the number exists in the items list; otherwise, the method should return False. Use the binary search algorithm for this task. For example, if objStat = Stat ( [5, 3, 7, 3, 6, 4, 5, 8, 2, 9, 3, 4, 20, -10] ) and the user invoked the the belongStat ( ) method with 8 , then the method will return True

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Smith and Roberson Business Law

Authors: Richard A. Mann, Barry S. Roberts

15th Edition

1285141903, 1285141903, 9781285141909, 978-0538473637

Students also viewed these Mathematics questions