Question: this needs to be coded but I do not know how to do it... Programming 10 Template Refer to the instructions on Canvas for

this needs to be coded but I do not know how to do it...

"""

Programming 10 Template

Refer to the instructions on Canvas for more information.

"I have neither given nor received help on this assignment."

author:

"""

__version__ = 1

# -*- coding: utf-8 -*-

class NumberStorage:

'''

The data parameter will contain a non-empty list of integers.

'''

def __init__(self, data):

self.__data = data

self.__min = 0

def getMin(self):

return self.__min

def findMax(self):

'''

Objects that are created from this NumberStorage class will be initialized with a

list of integers that are stored in self.__data.This method will identify and

RETURN the largest value in that list.

'''

pass

def findMin(self):

'''

This method will identify the smallest number in the self.__data list, and then

will STORE that value into self.__min.(The value will then be accessible using

the getMin() method.

'''

pass

######################################################################################

def main():

# You can test your solutions by calling them from here

'''

Here is an example of a test that you can write for findMax:

data = [1,2,3,4,5]

testObj = NumberStorage(data)

assert testObj.findMax() == 5, "The largest value in [1,2,3,4,5] is 5."

Here is an example of a test that you can write for findMin:

data = [1,2,3,4,5]

testObj = NumberStorage(data)

testObj.findMin()

assert testObj.getMin() == 1, "The smallest value in [1,2,3,4,5] is 1."

'''

pass

if __name__ == "__main__":

main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!