@@ -5,6 +5,21 @@ Input is provided in this format:
...
@@ -5,6 +5,21 @@ Input is provided in this format:
type,from,stock,qnt,price
type,from,stock,qnt,price
```
```
Compile Main.java file using this command. It will compile all dependent classes:
```
javac Main.java
```
Execute the program using this command:
```
java Main
```
Sample input can be provided with the input file like this:
```
java Main < input
```
# Design
# Design
There are 6 classes defined in this code.
There are 6 classes defined in this code.
...
@@ -32,4 +47,16 @@ The program currently maintains two linked lists - one for orders of type buy, a
...
@@ -32,4 +47,16 @@ The program currently maintains two linked lists - one for orders of type buy, a
Pending orders are stored in these linked lists in chronological order. It finds the matches for an order through a linear scan and removes matched orders or modifies a partially matched order. If trade is possible, matched orders are return to Main class and displayed to the user.
Pending orders are stored in these linked lists in chronological order. It finds the matches for an order through a linear scan and removes matched orders or modifies a partially matched order. If trade is possible, matched orders are return to Main class and displayed to the user.
# JUnit Tests
# JUnit Tests
JUnit tests for a class is provided in file with same class name appended with "Test". For example, tests for OrderMatching class is in OrderMatchingTest class.
JUnit tests for a class is provided in file with same class name appended with "Test". For example, tests for OrderMatching class is in OrderMatchingTest class.