This class contains common attributes and methods across buy and sell orders. This was done to avoid redundancy.
#### BuyOrder class
It inherits from Order class.
#### SellOrder class
It also inherits from the Order class.
#### Customer class
This class currently contains one variable for customer id. In future, if more details about customer needs to be stored, it can be easily extended for that.
#### Stock class
This class contains one variable for stock name.
#### OrderMatching class
This class implements the logic for the program. It maintains two queues for orders of type buy and sell. It finds matched buy orders for a sell order and vice versa, if trade is possible. It implements several methods for validating the input and find matched orders.
# Algorithm
The program currently maintains two linked lists - one for orders of type buy, and one for orders of type sell.
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.