Hello, im trying to work on my assignment and im just wondering how yall think i should go about this because for some reason my brain isn’t working. Im fine with adding stuff to the portfolio with buy operations, im just confused on how to go about the sell operation when user enters more than in first occurrence in portfolio for example if user enters sell META 300 29.99 and portfolio has two objects of meta, one with 200 and another with 200 how can i sell all in first then remaining in second. Heres description example that was given that’s probably more clear
#how to go about this
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
You could always use a map per Company, where the key is the purchase date for example.
Thats the thing we haven’t really covered hashmaps
You could use a 2 dimensional array.