Answer:
Explanation:
The solution code is written in JavaScript.
Firstly create function doFv that takes no parameter (Line 1). Use prompt method to get user input for principal amount, annual rate, number of years and number of periods per year (Line 2 -5). This is also important to use Number function to convert the input from string to numerical. After receiving user input, call the function computeFutureValue by passing the four user inputs as arguments (Line 7).
In the function computeFutureValue, apply compound interest formula to calculate the amount to be paid (Line 12). And use console.log to display the amount to terminal (Line 13).