Question
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
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
Objective
To master working with File handlers and ArrayLists
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:
You are to store the data for each stock into an ArrayList
for example: 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
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.
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
public static double findAverage(ArrayList
public static double findStandardDeviation(ArrayList
public static double findCorrelation(ArrayList
3) Create ArrayList that store each stock correlation values against the other stocks. Example:
ArrayList
4) Create a 2D ArrayList called correlationMatrix at stores all the stock correlations Example: ArrayList
5) Output the contents of the correlationMatrix to the console and print out the values: Examples:
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started