Skip to content

Instantly share code, notes, and snippets.

@WanaByte
Created October 30, 2011 04:39
Show Gist options
  • Save WanaByte/1325498 to your computer and use it in GitHub Desktop.
Save WanaByte/1325498 to your computer and use it in GitHub Desktop.
Stock Portfolio
AA 100 32.20 
IBM 50 91.10 
CAT 150 83.44 
MSFT 200 51.23 
GE 95 40.37 
MSFT 50 65.10 
IBM 100 70.44 
Prices.dat
GOOG 509.71 
YHOO 28.34 
IBM 106.11 
MSFT 30.47 
AAPL 122.13 
SUNW 5.01 
AA 39.91 
CAT 78.58 
GE 37.38 
HPQ 38.15
Write a program that reads the portfolio in portfolio.dat, the stock prices in prices.dat, and prints out how much the portfolio has increased or decreased.
Extra Credit: 
Portfolio.dat and prices.dat both have a small number of stocks. At the meetup, a second set of files will have a much larger number of stocks to analyze. We'll use the comparison between both sizes to talk about writing code that is reusable and that scales to handle a larger number of inputs. 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment