Question: Assignment 1 : File I/O and ArrayList Deliverables: 1) A printed copy of source code to be turned in at the beginning of class 2)

Assignment 1: File I/O and ArrayList

Deliverables:

1) A printed copy of source code to be turned in at the beginning of class

2) A printout of the console output of the correlationMatrix contents

3) Email through Canvas a copy of the entire Netbeans project ZIPPED.

Overview

You are to read and parse the contents of the Stock_Data.txt. The Stock_Data.txt comma delimited file contains historical data on five stocks:

 Assignment 1: File I/O and ArrayList Deliverables: 1) A printed copy

You are to store the data for each stock into an ArrayList for example ArrayList x_stockPrices = new ArrayList();

Then you need to calculate the correlation matrix and display it in the console. Note the correlation matrix is a 2D ArrayList i.e

ArrayList> correlationMatrix = new ArrayList>();

Here are some useful formulas you need to complete the project. If you have any questions, please ask me I am here to help you.

of source code to be turned in at the beginning of class

Overview

You are to read and parse the contents of the Stock_Data.txt. The Stock_Data.txt comma delimited file contains historical data on five stocks:

What you need to do 1) You need to read store the stock price contents Stock_Data.txt for each stock into an ArrayList. Heads up remembered that the stock data file has a header that you need to deal with. Note, you will find the Stock_Data.txt file in the data folder of the Netbeans skeleton project provided to you.

Example:

ArrayList x_stockPrices = new ArrayList();2) Implement the following methods:

public static double findAverage(ArrayList prices)

public static double findStandardDeviation(ArrayList prices)

public static double findCorrelation(ArrayList firstPrices, ArrayList secondPrices )

3) Create ArrayList that store each stock correlation values against the other stocks. Example:

ArrayList xCorrelations = new ArrayList();

4) Create a 2D ArrayList called correlationMatrix at stores all the stock correlations Example: ArrayList> correlationMatrix = new ArrayList>();

5) Output the contents of the correlationMatrix to the console and print out the values: Examples:

2) A printout of the console output of the correlationMatrix contents 3)

APPL 158.59 153.54 155.68 158.02 Date 23.93 8/10/17 23.69 8/11/17 23.01 8/14/1723.18 GE 24.69 24.29 24.2 24.35 GOOG 922.9 907.24 914.39 922.67 10.36 10.22 10.22 10.35 APPL 158.59 153.54 155.68 158.02 Date 23.93 8/10/17 23.69 8/11/17 23.01 8/14/1723.18 GE 24.69 24.29 24.2 24.35 GOOG 922.9 907.24 914.39 922.67 10.36 10.22 10.22 10.35

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!