Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions