Hello everybody, I'm relatively a newbie when it comes to programming
with Java. I was wondering if somebody wouldn't mind looking over the
code I have written so far for my Java class and see if it looks
ok. It is supposed to do the following:
• The user will be prompted for the current price for the stock being processed.
• The program will then read a series of investments in from a file, “investment.txt”:
◦ The investments will all be for the same stock (all IBM or Microsoft …)
◦ The investments will have different purchase dates and purchase prices.
◦ The investments will be ordered
such that the oldest stock (one purchased first) is on the first line
in the file.
◦ The file will have the following format (ticker, purchase price, date, num shares):
IBM,6.50,5/3/1987,100
IBM,7.50,12/1/1987,100
IBM,9.00,3/14/1990,100
IBM,12.00,4/2/1996,100
IBM,23.45,8/26/1999,100
IBM,18.00,1/5/2001,100
• The data from the file and the
current price entered by the user will be used to create new Investment
objects.
• The investments will be stored
in a data structure that obeys the FIFO protocol (a Queue)
I believe I have everything taken care but would greatly appreciate any suggestions to improve the code.
( Investment Code belowCollapse )