COM6516: Final assignment (60%)
11 December 2018
1 Task
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).
1.1 Specification
1.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 obtained
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:
http://quotes.wsj.com/XXXX/historical-prices/download?MOD_VIEW=page&num_
rows=90&startDate=START&endDate=END
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:
http://quotes.wsj.com/AAPL/historical-prices/download?MOD_VIEW=page&num_
rows=300&startDate=01/01/2018&endDate=12/31/2018
1.1.2 Handling Stock Market Data
The stock market data is provided in comma separated value (CSV) format that includes
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)
1
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 MarketGUI.java. Your solution should
run using Java version 1.8. Your code should compile on the command line by executing
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.)
2
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, optionally,
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 consistently.
Before you hand in your code, ask yourself whether the code is understandable
by someone marking it.
1.2 Hints and suggestions
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 storing
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.
2 Rules
2.1 Unfair means
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.
2.2 Submission
2.2.1 Deliverables: what to hand in
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
3
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 heidi.
christensen@sheffield.ac.uk in advance to make arrangements for submitting it by
e-mail.
3 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.
4
Points Categories and example scores
10 Compiling
10 It compiles with javac *.java with no modifications.
6–9 All files compile with a few simple changes to the package structure
(e.g., deleting package directives).
1–5 Some files do not compile; or compiling requires more significant
changes to the directory, file or package structures.
0 It can’t be compiled without modifying the code itself.
15 Running
+2 points Extra points if a significantly extended GUI has been implemented
10–13 It runs and meets most of the specification, and retrieve and display
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.
1–10 It runs but deviates from the specification
0 It doesn’t run.
10 GUI
10 A very good GUI with a main component that looks like a proper
stock market viewer, with nicely formatted graph and text
7 A GUI of more basic quality
10 OOP principles: data structures, class design, event handling
15 Comments, style, readability
60 Total
Marks and feedback will be returned through MOLE within 3 weeks.
版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。