Answer to Question #232805 in HTML/JavaScript Web Application for Munukuntla Swetha

Question #232805
Given principal amount principal as an input, time period in years time and appreciation percentage apprPercentage as optional inputs, write a JS function to return the final value finalValue with the given appreciation percentage and time period. The default values for time and apprPercentage are 2 and 5 respectively.
1
Expert's answer
2021-09-03T08:28:53-0400
function calculateFinalValue(principal, time = 2, appreciation = 5) {
    let finalValue = principal * (1 + time * appreciation / 100)
    return finalValue
}



var principal=prompt("")
var time=prompt("")
var appreciation=prompt("")


console.log( calculateFinalValue(principal));
console.log( calculateFinalValue(principal,time,appreciation));

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS