diff_months: 21

Data Structures Essentials Assignment On GameStonk Share Trading

Download Solution Now
Added on: 2022-08-20 00:00:00
Order Code: 444447
Question Task Id: 0
Background knowledge

In this assignment you will develop a very basic stock market with a stock exchange, brokers that process trades, and trades for different companies stocks. In this assignment, we have:

  • A listed company is a company whose shares are bought and sold. Each company has a name, a company code that is an abbreviation of its name, and the current price of its shares.
  • A trade object contains the number of shares to buy/sell, which company those shares need to be from, and which broker will process that trade.
  • A broker takes trades from individual users and puts them in single a queue to process. Because brokers are experts at what they do, they also have a watchlist of which companies they recommend people buy shares for. Whilst trades should be processed on a first-in, first-out queue, some unethical brokers might decide to delay when certain trades are processed by putting them at the back of the queue so they could process their own trades first. This is what we'll be looking at in this assignment.
  • A stock exchange has a collection of brokers that can buy and sell stocks on it. Each time the stock exchange processes trades, it asks each broker for the next trade in their queue to process. The exchange then processes that trade which causes the company on the trade s share price to go up or down. This process is then repeated to process additional trades.
What you will learn in this assignment

This assignment will help you understand the following concepts:

  • Creating your own linked lists
  • Basic use of Priority queues
  • Basic use of maps/hash maps
  • compareTo() for comparing objects
  • Basic exceptions
  • Unit testing and Junit
Getting Started

This assignment is an Eclipse project with existing class files that you will be required to complete in varying forms by changing method bodies, return types, creating getters, and setters. In addition to the classes you will be editing, there are a number of Junit tests that are used by a marking program to give you an indication of how well your code is working. Any changes you make to the class files listed below should be in-line with this requirement specification, any documentation in the code itself, and passing the tests. You do not need to edit any of the text files, or the marker, we will be using our own version of them for marking. However, you may find it useful to edit the test files for debugging purposes.

Getting it running
  1. Download the ZIP from the course web page and unzip.
  2. In Eclipse File Open Projects from File System and open the project
  3. There are two ways you can run the tests:
    • The first will run the entire marking program and give you an overall score and marks. Go into the AssignmentMarker.java file in the Junit package and run the file. The console will show you the output from the test marker. Note that you'll see lots of things going wrong and it does t run completely! That s ok, we'll work on that. As you complete more of the code, more of the assignment marker will be able to run.
    • The second way is to go into one of the Junit test files specifically, e.g. open up List Test.java and hit run. You should see Junit tests appear in your window and console, showing the output of each test run:

In the bottom left section of the screenshot above it will show a stack trace for any test you click on that failed. This will be what you can use to start debugging what s happening.

Using the above, you can run the whole marker, or just an individual set of tests for a specific class, which makes it easier to focus on one class at a time. As you go through and complete functionality in each class, run the tests for that class to see how successful you were in passing those tests.

Please note that whilst we have provided SOME tests, it does not mean the tests cover everything. Additional tests will be used to mark your assignment, so please review your code and make sure it s not just passing the tests you have, but also handling any other scenarios it should be.

  • Uploaded By : Albert
  • Posted on : July 27th, 2022
  • Downloads : 0
  • Views : 155

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan


80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing


30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%


20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more