Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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.

image text in transcribed

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:

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Foundations Technology Fundamentals For IT Success

Authors: Bob Bryla

1st Edition

0782143725, 9780782143720

More Books

Students also viewed these Databases questions

Question

What do you consider your core values?

Answered: 1 week ago

Question

Q.No.1 Explain Large scale map ? Q.No.2 Explain small scale map ?

Answered: 1 week ago

Question

Which team solution is more likely to be pursued and why?

Answered: 1 week ago

Question

4. I can tell when team members dont mean what they say.

Answered: 1 week ago