JavaScript



E-Commerce

Assignment 3

Functions, Looping and Table

Dr. John P. Abraham

Due date: 9/29/2019.

You can write this program in either javaScript or php.

Write a program to find the future value of monthly investments. Start with an initial investment, make a deposit every 30days (I am purposely giving you 30 days instead of 1 month to make it easy for you not having to calculate days of each month), calculate interest on principle compounded daily, display a table showing beginning balance, deposit for the year, interest earned for the year, and ending balance. For the interest rate or rate of return find the average stock market return for the past 10 years and use it. The table should display the aforementioned information for a duration of your present age to 65. Create a page break for every 20 years, displaying header and table. You are welcome to display in an appealing manner; at the minimum, it should have the following information.

You must calculate a single day’s interest using this formula: principle*rate/100/365.

This assignment is to teach you how to use looping effectively. Please pay attention that every few years there will be an additional monthly deposit, as we are making a deposit every thirty days, rather than monthly. The extra five days accumulated will add a deposit every 6 years.

I am posting this early because you will take more time to complete this assignment, unless you are experienced in inner and outer loops.

|Future Value Calculation |

|Initial Investment: $2000 |

|Interest Rate: 12% |

|Deposit every 30 days: $100 |

|Investment started: 50 |

|Age |Beg Bal |Interest |Deposits |Ending Bal |

|51 |2000 |324.65 |1200 |3524.65 |

|52 |3524.65 |519.01 |1200 |5243.66 |

|53 |5243.66 |738.14 |1200 |7181.79 |

|54 |7181.79 |985.2 |1200 |9366.99 |

|55 |9366.99 |1263.76 |1200 |11830.74 |

|56 |11830.74 |1577.82 |1300 |14708.57 |

|57 |14708.57 |1944.67 |1200 |17853.24 |

|58 |17853.24 |2345.54 |1200 |21398.77 |

|59 |21398.77 |2797.5 |1200 |25396.28 |

|60 |25396.28 |3307.08 |1200 |29903.36 |

|61 |29903.36 |3881.62 |1200 |34984.98 |

|62 |34984.98 |4529.4 |1300 |40814.38 |

|63 |40814.38 |5272.5 |1200 |47286.88 |

|64 |47286.88 |6097.58 |1200 |54584.46 |

|65 |54584.46 |7027.83 |1200 |62812.29 |

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download