COM6516: Final assignment (60%)

11 December 2018


1 TaskThe 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).

1.1 Specification1.1.1 Obtaining Stock Market Data

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 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 andEND the last date. Therefore, the following URL retrieves data about Apple Computers (AAPL) for 2018:

_  1.1.2 Handling Stock Market DataThe 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).

1.1.3 Program GUI (basic version)

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.

1.1.4 Extending the GUI (extra credit)

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.

1.1.5 Implementation

The main class in your solution should be called Your solution should run using Java version 1.8. Your code should compile on the command line by execut- ing the command “javac” 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.

1.2 Hints and suggestionsStart 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. 1 Rules1.1 Unfair meansThis 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. 1.2 Submission1.2.1 Deliverables: what to hand in

Upload your files to MOLE using the assignments button on the menu bar. Do

not submit any other files, such as or files.  The general expectation is

that you will have a separate 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!):

javac *.java

java NameOfMainClass

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

in advance to make arrangements for submitting it by


2 Marking

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.

Mark table

Marks and feedback will be returned through MOLE within 3 weeks.