COM6516: Final assignment (60%)
The task for this assignment is to design and build a viewer for stock market data. The viewer should download the data from the internet and present it to the user via a GUI. The due date is 14 January 2019 at midnight GMT (UK time, as indicated on MOLE).
Your program should retrieve data from Wall Street Journal (https://quotes.wsj. com). Data about the value of a company’s shares on a stock market is normally ob- tained via a ticker symbol (see https://en.wikipedia.org/wiki/Ticker_symbol). For example, a ticker symbol for Microsoft is MSFT.
Stock market data can be obtained from Wall Street Journal using a URL constructed in the following way:
where XXXX is the company ticker symbol, START the first date of the data and
END the last date. Therefore, the following URL retrieves data about Apple Computers (AAPL) for 2018:
The stock market data is provided in comma separated value (CSV) format that in- cludes the following information about the value of a company’s stock each day:
Date (the date)
Open (the stock price at the start of the day)
High (the highest price the stock reached during the day)
Low (the lowest price the stock reached during the day)
Close (the stock price at the end of the day)
Volume (the number of shares traded that day).
The data is normally complete and well formatted, but your program should be able to handle cases where it is not (e.g. missing values). Your program should also be able to cope with the situation where no data are available (for example if the date requested is in the future or if data is missing).
When the program starts, a window should be displayed with drop down boxes for the user to select a ticker symbol from a list (you can choose how many symbols are in the list but there must be at least two), and select the start and end dates using drop down boxes for the years, months and days. When the user has selected the dates and ticker symbol, clicking on a button should retrieve the appropriate stock market data.
The data that is retrieved should then be displayed in a new window (i.e. a window that is separate from the one used to select the ticker symbol and dates). This window should display a graph showing the stock’s closing value for each day in the range that was entered.
You may choose to extend the GUI to display more information about the stock market data. Extra information that could be included about the stock is:
The opening price each day
the high and low prices
the volume of stocks traded
You should decide on the best way to present this information so that it is easy to understand. For example, you may choose to include all information in a single graph or use multiple graphs.
The main class in your solution should be called MarketGUI.java. Your solution should run using Java version 1.8. Your code should compile on the command line by execut- ing the command “javac MarketGUI.java” and run by executing the command “java MarketGUI”. (You may assume that the Sheffield package is accessible when your code is compiled and run.)
Your solution should only make use of the core Java Class Libraries. It should not make use of any external Java libraries (e.g. packages to draw graphs) other than, op- tionally, the Sheffield package.
Your GUI should display the required data clearly. There should be one window that allows the user to select the input data (ticker symbol and dates) and another to display the information retrieved from WSJ, as specified above in the requirements. Credit will be assigned for GUIs that are easy to use, display the information in a way that is easy to understand and are aesthetically pleasing.
Readability is of great importance for coding style. You should therefore take great care with line breaks, document your code appropriately and use indentation consis- tently. Before you hand in your code, ask yourself whether the code is understandable by someone marking it.
Start by downloading some example data from the WSJ Finance server. Take a look at this file using a text editor such as jEdit, and make sure that you understand how it is structured. Your program should be able to deal with this data in a sensible way.
When you design your solution you should consider separating the reading and stor- ing of the stock market data from displaying it to the user. One approach would be to read the data from the WSJ site and store it as a collection of objects. An ArrayList could be an appropriate way to manage these data. You can use the Sheffield package to read data from the file.
The GUI displays stock market information using one or more graphs. One possible approach would be to implement a method that can display a suitable graph using the Graphics2D library in such a way that it can be applied to different types of data.
This is an individual assignment so you are expected to work on your own. You may discuss the general principles with other students but you must not work together to develop your solution. You must write your own code. All code submitted may be examined using specialized software to identify evidence of code written by another student or downloaded from online resources.
Upload your *.java files to MOLE using the assignments button on the menu bar. Do not submit any other files, such as *.class or *.jar files. The general expectation is that you will have a separate *.java for each class. If you choose to use the sheffield
package you do not need to upload it, I will compile with it. This assignment does not require any other libraries other than the Java standard library, and no other libraries will be used when your code is compiled and executed for marking.
Your code should compile and run under Java 1.8 on the command line (make sure to check your code for inclusions of packages that I will not have access to!):
You can submit your work more than once; the last version submitted will be marked, so check it carefully. You will not be able to submit any code after the final deadline.
If you are unable to upload your code to MOLE for technical reasons, e-mail heidi. firstname.lastname@example.org in advance to make arrangements for submitting it by e-mail.
Because of the much greater time available to work on this assignment (compared with the assessed labs), the compiling category constitutes a lower proportion of the mark, and the relative value of comments, style, and readability is greater.
Points Categories and example scores
It compiles with javac *.java with no modifications.
All files compile with a few simple changes to the package struc- ture (e.g., deleting package directives).
Some files do not compile; or compiling requires more significant changes to the directory, file or package structures.
It can’t be compiled without modifying the code itself.
Extra points if a significantly extended GUI has been imple-
It runs and meets most of the specification, and retrieve and dis-
play data as required. There are two windows - one for selecting
which data to display, and one for displaying the data. It does
not abort if the user tries to request data with missing parts.
It runs but deviates from the specification
It doesn’t run.
A very good GUI with a main component that looks like a proper
stock market viewer, with nicely formatted graph and text
A GUI of more basic quality
OOP principles: data structures, class design, event handling
Comments, style, readability
Marks and feedback will be returned through MOLE within 3 weeks.