Re: Array List implementation(Buying and selling)
When a sale is made, you will have to sell a specific quantity. When you get a Transaction from the list, it may or may not have enough quantity to cover the sale. In the easy case, the sale is the same number available in that Transaction. In the other two cases you will either have some left over or need to grab the next Transaction and sell some of those too. Worry about the nested class first, once that is in place it will be easier to work on the math.