The Problem
I want a console program that manages a stock portfolio. Here's what makes up a portfolio:
Portfolio: The entire portfolio
Owner: The owner of the portfolio
Stock: The description of an individual stock
Transaction: Record of a purchase or sale of shares of a stock
The owner has a name and social security number. The portfolio should only have one owner, but the portfolio may have several stocks. Each stock has a company name (for example, International Business Machines), a ticker symbol (IBM), and the current market value for each share. There may be several transactions for each stock. Each transaction has a date, whether it is a purchase or sale, the number of shares involved, and the price for each share. Each of these can be represented as a self-contained object, with well defined data and operations.
Some of these objects contain other objects. The portfolio contains an owner, a collection of stocks, and perhaps some additional information. A stock contains not only its description, but also a list of the transactions which have occurred. The objects are independent of each other, for example, the owner object doesn’t know about transactions, and the transactions don’t know about the stock which they represent.
The program should:
* Purchase shares of a particular stock
* Sell shares of a particular stock
* Set the current market value of a stock
* List the total value of the portfolio
* List the stocks in the portfolio with their cost and current value
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 3) Complete ownership and distribution copyrights to all work purchased.
## Platform
Using only standard C++, it should compile with either Visual Studio or g++ and run on Linux or Windows.