Purpose
The purpose of this assignment is
- To give you practice in using the C++ input/output classes and file I/O.
- To give you practice in program planning, design and development.
- To solve a practical "real-world" problem.
This program will track a portfolio consisting of three mutual funds over a ten year period. You will invest $10,000 exactly 10 years prior to the date that you run your program. You will use actual mutual fund historical data that you will download as input files to your program.
Requirements
Your must use a main() that is similar to the sample below. The "real work" should not be performed in main().
Your program output file should "logically" match that of the sample output below. You will probably use different mutual funds and run your program for different dates. You must display the initial investment data for your portfolio, the value of the portfolio 5 years ago, 3 years ago, 1 year ago, at the beginning of the year and the current value.
You should turn in the program listing and your output file.
Your solution must contain at least 3 classes, one of which is a "date" class. The "date" class must contain an overloaded insertion operator that "prints" a "date" in an "mm/dd/yy" format.
You are to use the actual downloaded mutual fund historical data. You may not edit this data.
You are to use the closing prices of the mutual on the date of interest. If that date is not a "market open" date, then you must backup and get the previous closing price of the fund.
You must invest at least $3000 in each fund.
References
Yahoo finance page: http://finance.yahoo.com/
You can look up mutual fund data by entering the "ticker" symbol next to the Get Quotes button at the top of the page. On the mutual fund "Summary" page, use the "Historical Prices" link on the left side of the page to get the history. On the "Historical Prices" page, use the "Download to Spreadsheet" link to download the mutual fund history to a file. Note, the download file is named table.csv, so you need to give it a unique name, since you'll need three different mutual fund history files.
You can find lots of good funds on these sites:
http://bloomberg.com/apps/data?pid=invest_mutualfunds
http://www.kiplinger.com/investing/funds/kip25/tables/index.php
http://www.smartmoney.com/top25funds/http://www.morningstar.com/allanalyses/analysesLists.html?type=FO&fsection=all2000&lpos=Commentary
http://moneycentral.msn.com/investor/research/fundwelcome.asp?Funds=1
Assumptions
Assume that the input data is reliable, that dates and the mutual fund closing prices are valid.
Assume that you do not have access to dividends or capital gains. There is no reinvestment. You give all that money to charity (or the teacher).
Suggestions
Allow 4-12 hours to solve this problem. You will need more time for program planning and analysis than the previous assignments.
Extra Credit
The student with the most valuable portfolio using "today's" closing prices will receive 2 extra credit points. In the event of a tie, only 1 point will be awarded. Remember, actual data must be used for this, but you are free to run the program on different days. By completing the program early, you can pick a day with a good market close.
Sample main()
int main()
{
Date today;
Portfolio myPortfolio(today.nYearsBefore(10));
myPortfolio.addFund("VTSMX",3333.33f,"c:/deanza/data/vtsmx.csv");
myPortfolio.addFund("VGTSX",3333.33f,"c:/deanza/data/vgtsx.csv");
myPortfolio.addFund("VBMFX",3333.34f,"c:/deanza/data/vbmfx.csv");
ofstream fout("c:/deanza/data/ass9.out");
myPortfolio.report(today,fout);
return 0;
}
Sample Program Output File
Mutual Funds VTSMX VGTSX VBMFX Total
Initial Investment 06/06/99 3333.33 3333.33 3333.34 10000.00
Initial Shares 132.380 358.808 572.739
Value 5 years ago 06/06/04 3243.31 3519.91 4547.55 11310.77
Value 3 years ago 06/06/06 3828.43 5098.67 4874.01 13801.11
Value 1 year ago 06/06/08 4314.27 6562.61 5544.11 16420.98
Value on January 1st 01/01/09 2953.40 3950.48 5715.93 12619.81
Value today 06/06/09 3060.63 4345.17 5738.84 13144.64


