Starting template:
comp6010_s1_2020_assignnment_4_template.zip (at the bottom of this page). Contains two sample projects:
1. basic_example_student_performance: includes template and solution
2. advaced_example_soccerFTW: includes only solution
-----------------------------------------------------
Introduction
Assignment 2 handles stock information using Java's A
ayList class.
The data is read from csv files and you are not required to do any file input output.
Each file contains two numbers on the first line, representing number of stocks purchased and unit price at which they are purchased. For example, in BVB.csv, number of stocks purchased is XXXXXXXXXXand unit price is 7.6.
The second line is a heade
Date Open High Low Close Adjusted Close Volume
The third and subsequent lines contain the actual data. For example, the first line in BVB.csv is,
2/10/ XXXXXXXXXX XXXXXXXXXX533080
that represents, that on 2nd October 2018, BVB stock opened at $7.895, reached a high of $8 and a low of $7.805, closed at $8, and had an adjusted close of $ XXXXXXXXXXThe number of stocks traded on the day were 533080.
Some points about data quality:
1. you may assume the trades are in chronological order.
2. just because we are using 2018 data doesn't mean that's always going to be the case. I can test the final submissions with 2015 or 2012 data as well.
Class relationship
StockHistoricalData holds a collection of DailyTrade objects. PortFolioEntry holds the historical data for a stock along with details of quantity and price at which it's purchased. PortFolio holds a collection of PortFolioEntry objects.
Topics assessed
The assignment assesses topics from week 8 lecture (week 8 and 9 practical classes) - Java's A
ayList class.
Files to complete
The three classes that you must work on (in that order), are all in toBeModified package,
1. StockHistoricalData.java:Â 23 methods (worth 92 marks)
2. PortFolioEntry.java: 1 method (compareTo) (worth 4 marks)
3. PortFolio.java: 1 method (sort) (worth 4 marks)
Each method is worth 4 marks.
The description for each method is provided as Javadoc.
You are not required to edit other files (Date, DailyTrade, Client, and the test files).
Co
esponding tests are in tests package.
Specific method notes
· getPeakPrice() - the intraday high should be used to compute this, since someone sold (and someone else bought) at this price
· getBottomPrice() - the intraday low should be used to compute this, since someone sold (and someone else bought) at this price
Helper methods
You can add as many helper methods as you want in your classes. As long as the tests work, it's all good.
Submission format
Drag and drop the following three files from Eclipse to the submission box.
1. StockHistoricalData.java
2. PortFolioEntry.java
3. PortFolio.java
Submission box accepts three java files and the responsibility to upload the co
ect files (with the co
ect names) is on you. I will not entertain any requests where inco
ect file(s) have been uploaded. The safest way is to drag from Eclipse and drop into the submission box.