Makeup Assignment - Compare Two Mutual Funds

Recording

Detail report file updated 11/25

due Sunday, November 29th,  8:00 pm

This optional assignment may be used to add to your midterm score or to replace your lowest assignment grade. It is worth a maximum of 20 points. You may not raise your midterm score above 90.  Your goal in the completion of this assignment is to raise your grade, to learn something, to gain a sense of accomplishment, and to write a program that you are proud of.

The assignment is not charity.  Do not turn in an incomplete assignment.  Do not turn in the assignment late.  Do not turn in an assignment with errors.  Do not turn in an assignment with the wrong answers.  You can code tests cases using the sample output below.  The assignment will not be accepted late or with errors.

Appointment Times for Oral Review

Monday 11/30 am:      11:15  11:30  11:45
Tuesday 12/1 am:       11:15  11:30

Request an appointment time and alternate time after you submit your assignment.  Your requested time will be confirmed by return email.  This list of available oral review appointment time will be updated as requests are filled.  Recheck (and refresh) this page for available times just prior to submitting your assignment.  Additional times will be added, if necessary.  Contact the instructor if you are unable to meet during any of the available appointment times.

Terms and Conditions

  1. This assignment must be submitted by email. Include your program source code, 4 input files, sample output, and the output detail file as attachments. The assignment must be received by November 29th,  8:00 pm .
  2. You must also schedule a ten minute oral review of the code on either Monday 11/30 or Tuesday 12/1.  The review will consist of 5 questions about your solution.  If you are unable to satisfactorily answer questions about your code, you will not receive credit for the assignment.  The purpose of this oral review is to prove that the code you submit is yours and that you can communicate your design and implementation.  Sample questions:
  3. You may not get any help on this assignment from other students, friends, co-workers, or family members.  You may ask the instuctor for assistance or clarification.  Any assignments received with obviously similar solutions will be rejected.
  4. When you submit your assignment, you must specify whether you want to apply the points toward your midterm or to use it to replace your lowest assignment grade
  5. As part of the grade, the instructor will compile and execute your source code. Programs that do not compile, or do not run, will not be accepted.
  6. The grade received on this assignment will be applied to your midterm points or toward the lowest or missing assignment grade.  Your midterm grade may not exceed 90 points.
  7. Your grade will be based on completion of the program requirements listed below, program accuracy, ingenuity, conciseness, code re-use, documentation, neatness, and the oral code review.  Grading on this assignment will be strict.  The instructor will check the accuracy of your detailed report, running the same mutual funds and dates that you submit.  On this assignment, you will be penalized for a lack of neatness or organization of your code, and also for compiler warnings that are the result of non-portable code or inaccurate coding techniques.

Program Objective

This program will compare two mutual funds over 100 random time periods to determine the fund with the best average gain over the periods.  The comparison will be made by comparing the gain of the net asset value (NAV) from a buy date to a sell date, taking into account any dividends paid during the random date interval.  Make sure you use the close data and not the adjusted close data for the NAV.  The interval must span at least 100 market days.  The final result will be a summary result, such as

Average gain for VTSAX = 8312.38
Average gain for VFIAX = 8142.20

Program Requirements

  1. Your solution must contain the use of 2 or more classes of your design.
  2. The program must read in four data files.  There is a historical price file and and a dividend file for each fund.
  3. The historical price and dividend data must be stored in arrays or vectors.
  4. The history data must contain the same dates for both mutual funds.
  5. The data files contain data for about 15 years.
  6. Use $10000 as an initial investment for each fund.  You will buy $10000 in shares on the purchase date, then sell those shares + dividend reinvested shares on the sell date.  Note, dividends are not awarded on the purchase date, but may be on the sell date.
  7. In addition to the Average gain results from above, the program must produce a detail report file showing the result of each random comparison.  It should look like the output below.  
Input Files

Detailed Report File  (Output updated 11/25)

  Buy Date    Sell Date VTSAX Value  VTSAX Gain VFIAX Value  VFIAX Gain VTSAX-VFIAX
03/03/2005   12/01/2014    21614.41    11614.41    20796.79    10796.79      817.61
04/23/2014   02/09/2015    11021.72     1021.72    11089.03     1089.03      -67.30
09/14/2017   11/18/2019    12885.15     2885.15    13046.13     3046.13     -160.99
11/23/2016   09/21/2020    15729.70     5729.70    16028.55     6028.55     -298.85
04/28/2008   09/27/2010     8879.72    -1120.28     8669.12    -1330.88      210.61
10/11/2006   06/09/2015    19266.12     9266.12    18541.84     8541.84      724.28
03/02/2006   08/09/2006     9787.09     -212.91     9894.37     -105.63     -107.29
10/05/2010   11/25/2015    19963.34     9963.34    20039.38    10039.38      -76.04
11/19/2019   08/04/2020    10721.05      721.05    10738.44      738.44      -17.39
10/12/2010   12/29/2011    11052.18     1052.18    11070.82     1070.82      -18.64
02/05/2016   02/13/2019    15720.18     5720.18    15559.71     5559.71      160.47
06/05/2012   08/27/2020    31356.94    21356.94    32045.72    22045.72     -688.78
10/14/2011   04/23/2014    16349.59     6349.59    16164.38     6164.38      185.22
...

Recommendations

The dividend files are not sorted.  You should sort the dividend data after you read in the files.
Use the above sample output to check your answers.  You will need a method to specify the "random data range" for testing purposes.