Hi guys, having a bit of a problem with my java assignment. I have a books.dat file and a transactions.txt file. The contents of the books.dat file and transactions.txt file can be seen here: http://pastebin.com/9smH0mUL Part of my assignment is that I need to update the inventory according to the transactions so the final inventory should be displayed as shown in the pastebin link. Since I cannot write much more here, I have listed my full problem in the pastebin link above. This is my method so far: http://pastebin.com/v0dd0yRf Any help is really appreciated.
It looks like you're reading books.dat for every line in transactions.txt. I'd approach it more reading books.dat and putting it in some kind of structure, and then operating on it line by line from transactions.txt, and then output it afterwards. Without knowing what's going on in your class, it's hard to get more specific.
Join our real-time social learning platform and learn together with your friends!