Phase 2 of the big project
You can now checkout the blank project 2 from the repository:
svn checkout file:///cslab/class/cs335/XXXXX/projrepos/proj2
where "XXXXX
" is tdjd
or
sbcj
.
As we discussed in class, the first thing you'll need
to do with your new partners is
- Look at each other's code, point out the drawbacks and
strengths, learn from each other, and merge them into one
code base.
- Fix up anything from phase 1 that's not quite right--- unless
something in phase 2 makes it obsolete or irrelevant.
The portfolio needs to keep information (from the user's
perspective, at least) on each stock's date of
purchase, basis (total original value), number of shares, and current price
per share.
The portfolio is manipulated, we will now distinguish between
the following four events:
- A correction-- the user edits the old information to
modify what was previously entered.
- A price change-- an update to the price per share of a stock
because of a change in the market price.
- A stock split-- the number of shares changes because
a company decides to split its stock to reduce its
price per share. Notice that this does not affect the basis.
- A transaction-- the user purchases stock or sells stock.
For a purchase, the user must enter the stock name, symbol,
date, basis, number of shares, and (if the stock is not already
in the portfolio) and initial current price.
For a sale, the user must enter the symbol, number of shares,
and the settled price per share.
- A stock buyout-- very similar to a sale; the represents
an event where a company is bought out and the investers are
given cash for their stake in the old company.
- A spin-off-- very much like a purchase; a company
spins off a division into its own company, and gives
investers a stake in the new company.
The portfolio must also keep track of (store or compute) the following
information:
- For each stock, the profit or loss on the investment.
- For the portfolio, the capital gains or loss.
This is the amount of money the investor has made or lost in investments
that have been sold.
A sale or buyout will affect this.
Here's one of many articles that gives some information
on computing capital gain, espcially on computing a basis
when there were multiple purchase of the same stock and you
are selling part of your investment in that stock.
I recommend always selling the oldest shares (rather than
allowing the user to choose).
- For the portfolio, a history of events (everything listed
above except corrections; a correction would imply an edit
to the history as well).
Finally, there should be an undo/redo operation;
this does not have to be persistent across times when
the user opens the portfolio.
DUE:Monday, Nov 5.
Thomas VanDrunen
Last modified: Mon Sep 17 11:07:00 CDT 2007