Write a program that: - include a class that accepts a list of numbers on instantiation . - in the class, write a method that recursively returns the upper bound (maximum) , and - write another method...

1 answer below »

Write a program that:


- include a class that accepts alistof numbers oninstantiation.


- in the class, write amethodthatrecursivelyreturns theupper bound (maximum), and


- write anothermethodthatiterativelyfind thelower bound (minimum)_.


- next create amain functionarea thatreads in the contents from a .CSVfileto create anarray or list data structure.That data structure should be passed tothe class you just developed.

Answered Same DayJul 19, 2021

Answer To: Write a program that: - include a class that accepts a list of numbers on instantiation . - in the...

Arun Shankar answered on Jul 20 2021
152 Votes
input_file.txt
3
6
1
8
5
9
10
2
main.py
class myClass:
def __init__(self,contents):
self.contents = contents
def upper_bound_helper(self, i, curr):
if(i==len(self.contents)-1):
return curr
if(curr>self.contents[i]):
return self.upper_bound_helper(i+1,curr)
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here