Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Statistics.py Python 3 please and thank you. On the course Canvas, you'll find the following file(s): - Statistics.py, which is an ADT covered in class

image text in transcribed

Statistics.py

image text in transcribed

image text in transcribed

Python 3 please and thank you.

On the course Canvas, you'll find the following file(s): - Statistics.py, which is an ADT covered in class and in the readings. For your convenience, we removed some of the calculations and operations (e.g., var() and sampvar (), that were not relevant to this exercise, which would have made testing too onerous. In this question you will define four new operations for the ADT: - range() Returns the range (difference between the minimum and maximum) based on every value recorded by the Statistics object. - mode() Returns the mode (the value that occurs most frequently) based on every value recorded by the Statistics object. - max() Returns the maximum value ever recorded by the Statistics object. - min() Returns the minimum value ever recorded by the Statistics object. Note: For each of the above, if not data was seen, the function should return None. Hint: To accomplish this task, you may have to modify other operations of the Statistics ADT. You will also improve the test script from Q2 to test the new version of the ADT, and ensures that all operations are correct. Remember: you have to test all operations because you don't want to introduce errors to other operations by accident; the only way to know is to test all the operations, even the ones you didn't change. To make the marker's job easier, label your new test cases and scripts so that they are easy to find. What to Hand In - A text file named a4q3_changes .txt describes changes you made to the existing ADT operations. - A Python program named a4q3.py containing the ADT operations (new and modified). - A Python script named a4q3_testing.py containing your test script. Be sure to include your name, NSID, student number, course number and lecture section at the top of all documents. Evaluation - 1 mark: Your added operation range ( ) is correct and documented. - 1 mark: Your added operation mode () is correct and documented. - 1 mark: Your added operation max() is correct and documented. - 1 mark: Your added operation min() is correct and documented. - 3 marks: Your modifications to other operations are correct. - 5 marks: Your test script has good coverage for the new operations

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 Implementation

Authors: Shouhong Wang, Hai Wang

1st Edition

1612330150, 978-1612330150

More Books

Students also viewed these Databases questions