In this assignment, you'll design & implement a calculator that computes the future value of an annuity. An annuity is a periodic (e.g., monthly) deposit that compounds at a specified interest rate for a period of time. Annuities are one of the most common financial problems encountered in personal finance and business investment analysis. The primary objectives of the assignment are:
Your calculator GUI must contain the following features:
Here is the general design of the calculator including necessary math for the annuity calculation. This program must be written using the two functions described below. You will likely run into difficulty debugging your code unless you run frequent tests while writing the functions. FYI, the entire program can be written in less than 20 lines of JS code. I highly recommend that you use this file as the basis for your assignment. It supplies a partial GUI and extensive pseudocode for both functions that should help guide you through the assignment. In case you are unsure about how to call a function from another function, here is an example.
This function takes no parameters. First, parse user inputs and assign to variables. If all user inputs are valid, then pass appropriate parameters to the calculateFutureValue function that calculates the future value, and display the return value from that function in the calculator's output field. To be valid, all inputs must be greater than zero. Otherwise, if any input is invalid, then display an error message requesting correct input data. Use 'alert("put your helpful error msg here")'
Calculate the number of monthly periods the investment will compound by multiplying the number of years by 12. Convert the annual percentage rate of return into a monthly rate (divide annual rate by 12). Convert monthly percentage into decimal equivalent (divide monthly percent by 100). Then add this decimal rate to 1.0. For example, an annual rate of 12% is a monthly rate of 1% yielding a decimal equivalent of 0.01. Adding 1.0 yields a rateFactor = 1.01.
Next, you calculate a futureValueFactor in the following manner. For each monthly period (from 1 to n where n = total number of months) raise the rate factor to the nth power and accumulate the total for all periods. Below is an example calculation. You must use a for loop to implement this calculation.
Assume user entered 12% annual rate for 0.25 years (i.e., 3 months), the futureValueFactor = (1.01)1 + (1.01)2 + (1.01)3 = 3.06. (HINT: See the JS library for a function that will raise a number to a power)
After calculating the futureValueFactor, calculate the future value of the annuity. The futureValue = monthlyDeposit * futureValueFactor. Continuing with the example above, assuming monthlyDeposit = $100, the futureValue = 100 * 3.06 = $306. This amount must be rounded to the nearest whole number and returned by the function. (HINT: See the JS library for a function that will round to the nearest integer)
Here is some data you can use to determine if your calculator is functioning properly.
The completed assignment is due by 10 pm Friday, March 17th. After that deadline, it is deemed late without penalty and may be submitted until 10 pm, Sunday, March 19th. No assignment submitted after that deadline will be graded and a zero will be assigned.BONUS!! Earn 7.5 bonus points if you (1) submit your assignment prior to 10 p.m. Wednesday, March 15th and your grade is no less than 90.
You must submit your entire website as a zip file ('LastNameWeb.zip') via the assignment feature in courseWeb. Your calculator must be in a file named annuityCalculator.html. The page should also give the user information on how to use the calculator. It must be in the IS10 folder that you created in the previous assignment. On the assignments.html page, add a link (in the bulleted list) to the annuity calculator.
You must use a text editor to compose your pages. If your pages contain any tool-generated tags, 25 points will be deducted from your grade. This assignment is worth 9 points.