subject

Python

Problem

Expected Duration: 3-6 hours

A comma-separated value file stocks_data. csv contains historical data on the Adjusted Closing Price for 3 stocks daily from Jan 2, 2009 to Dec 31,2018. The stocks are Apple (APPL), Microsoft (MSFT) and IBM (IBM).

A snippet from the data file looks like the following:

Symbol

Date

Adj. Close

MSFT

4/16/2014

35.807358

MSFT

6/21/2010

20.752356

IBM

2/10/2009

68.930023

AAPL

2/14/2018

164.227203

IBM

6/13/2017

141.24379

IBM

12/26/2017

142.835663

MSFT

4/1/2009

15.053272

AAPL

4/17/2009

15.445643

You can see that each row has a symbol, date and closing price, but the stock data is not sorted by symbol, date or price.

Your task has two main parts:

Part I

For each stock, print the following information to the console and to a text file called stock_summary. txt:

the max price and date it occurs
the min price and date it occurs
the average (mean) price
Part 2

Print to the console and append to the output file stock_summary. txt:

The stock among the 3 with the highest overall closing price and its date
The stock among the 3 with the lowest overall closing price and its date
Example output looks like the following:

AAPL

Max: price date
Min: price date
Ave: mean

IBM

Max: price date
Min: price date
Ave: mean

MSFT

Max: price date
Min: price date
Ave: mean

Highest: Symbol price date
Lowest: Symbol price date

Submission

Submit the source code for your program in Canvas as main. py, and your output file as stock_summary. txt. Submit these two in a file called stock. zip.

Be sure to use the file names specified here. No other names are acceptable.

Grading

Late submissions receive 50 points and no feedback.

0-20 points: design doc is correct and complete
21-100: all automated and manual tests pass

Tests

load data from csv input file
generate summary data for each stock (counts as 3 test cases)
compute the highest of all stocks
compute the lowest of all the stocks
use functions to minimize obvious repeated code
write output to file txt
writes output to console (same data and format as #6)
use loops in code
use appropriate modules and builtin functions to simplify code
code quality test passes with 0 errors
Points to Ponder

Thinking about files and the program:

What does your program do if the input file does not exist?
What does your program do if the output file does not exist?
What mathematical equations, forms or libraries did you use in your program?
If you worked on this program again, what would you do differently?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:30
Asalesman at a high end computer security firm want to sell you a proactive cover for your passport, which contains an rfid tag inside storing your sensitive information. the salesperson's solution cost only $79.99 and protects your passport from being read via radio waves while it is in your pocket. explain how you can achieve the same thing under $3.00
Answers: 3
question
Computers and Technology, 22.06.2019 09:40
Sarah is having a hard time finding a template for her advertising business that she may be able to use at a later date and also make it available to her colleagues
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
question
Computers and Technology, 24.06.2019 23:50
What is your fav video game currently: a) roblox b) fortnite c) apex legends d) pubg
Answers: 2
You know the right answer?
Python

Problem

Expected Duration: 3-6 hours

A comma-separated...
Questions
question
Mathematics, 29.01.2021 19:40
question
Mathematics, 29.01.2021 19:40
question
Chemistry, 29.01.2021 19:40
question
Mathematics, 29.01.2021 19:40
Questions on the website: 13722361