Computers and Technology

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?

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:20, milkshakegrande101
4. a1. vince owns a television repair shop that is insured undera commercial package policy. the policy includes thebuilding and personal property coverage form and thecauses-of-loss broad form. the declarations page indicatesthat coverage applies to both the building and the namedinsured's business property. explain whether or not thefollowing losses would be covered under his policy. a. a fire occurs on the premises, and the building isbadly damaged. b. a burglar steals some money and securities from anunlocked safe. c. a business computer is damaged by vandals whobreak into the shop after business hours. d. a tornado touches down near the store. several tel-evision sets of customers in the shop for repair aredamaged in the storm. til
Answers: 2
image
Computers and Technology, 23.06.2019 15:00, MalikaJones
In the blank libreoffice writer document, to start the process of entering a date field into a letter, click on the insert menu. edit menu. file menu. fields menu.
Answers: 3
image
Computers and Technology, 24.06.2019 02:40, homework1911
Has anyone seen my grandma shes been gone for 4 years already
Answers: 1
image
Computers and Technology, 24.06.2019 23:00, alyssa337
What is a current gdp and what is a real gdp?
Answers: 1
Do you know the correct answer?
Python

Problem

Expected Duration: 3-6 hours

A comma-separated...

Questions in other subjects:

Konu
Mathematics, 30.11.2020 20:00
Konu
Mathematics, 30.11.2020 20:00