Question: SENG 265 AD1/A02 Page 8 Question 22: Weight 30 Write a Python function called compute hlav) for analyzing a file containing stock pace or in

 SENG 265 AD1/A02 Page 8 Question 22: Weight 30 Write a

SENG 265 AD1/A02 Page 8 Question 22: Weight 30 Write a Python function called compute hlav) for analyzing a file containing stock pace or in the form YYYYMMDD, and an ending date in the form YYYYMMDD. The function will i adjusted close Foo e fanction will ccept three parameters: the name of the file, a starting date e, lowest price, and average dadly volume indicated by the data. Each line in the tile is formatted as "date open high Tow close volume example, if the file GE.txt" contains the following five lines: 20130312 8.73 978 8.43??9.57-3ss002000-9.44 20130313 9.9 9.98 9.3 9.62 216287500 9.49 20130316 9.97 10.36 9.6 .66 22619 0310 8.01 8.99 7.95 8.87...-368705700-8.75 and if the following line appears in a script using your function ?(high, average-volume)--con ute hlav("CE.txt.?20130311- 20130313") then high equals 9.98, Tow equals 8.31, and average volune equals 274206433. Assume all date values are legal. Hints: Use int (somestring), 'Float(somestring)" to convert a string to an integer and loat (respectively). Use "str(someval)" to covert a integer or floating point value to a string. Use "input open(filename, "r')" to open a fle named fi1ename and store the file pointer in "input". Make proper use of tuples and lists Your indentation must be clearly indicated. Some marks will be given for the quality of your answer. (This next page is available, jf needed, for your ansuwer to Question 22.)

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 Databases Questions!