Starting from:

$10

stock data solution

2. Write a program to process stock data. The stock data should be read from a text file containing the following data: stock code, stock name, amount invested (XXX.XX), shares held, and current price. Sue the internet or your local paper to gather data on at least 20 stocks.

As each stock is read, insert it into a doubly linked list. The first logical list should be ordered on the stock code. The second should be ordered on the gain or loss for the stock. Gain or loss is calculated as the current value of the stock (shares held times current price) minus the amount invested. Include at least one loss in your test data.

After building the lists, display a menu that allows the user to display either logical list forward or backward (a total of four options). Each display should contain an appropriate heading and column caption.



Run your program and submit a list of your input data and a print out of each display option.



Answer:

For code,look at java files provided. Main.java is main file. It reads stock.txt and creates lists

More products