Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need some help with JQUERY code changes will be made in the future_value.js file. You will be creating a calculateClick function that will fire when

image text in transcribed

Need some help with JQUERY code changes will be made in the future_value.js file.

You will be creating a calculateClick function that will fire when the button with the ID calculate is clicked.

This function should ensure that the investment, rate and years have valid numbers and is greater then zero.

Hint - isNaN(investment) || investment

If all of them are valid I want you to then run the math formula to calculate the future value. You will need to loop through the amount of years.

Also note that in your for loop you need to use a running total

Hint variable += formula.

After you have looped through the years and have your total, you need to display it in the #future_value input box. Make sure your total variable has the .toFixed() method on it, for full numbers.

Hint look at .val() in JQuery for getting and setting values.

Future value js file i started

var calculateClick = function () { // Your code goes here.

}

$(document).ready(function() { $("#calculate").click(calculateClick); $("#investment").focus(); });

the HTML :

Future Value Calculator

Future Value Calculator

Future Value Calculator Investment Amount 10000 Annual Interest Rate: 20 Number of Years: 5 Future Value: 24883 Calculate

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions