Answer to Question #268204 in HTML/JavaScript Web Application for swsq

Question #268204

only 1 testcase is getting fail where its loged in console as NAN. The formula to calculate the final value with appreciation is, finalValue = principal * (1 + time * appreciation / 100).

Final Value with Appreciation:

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.

Input

1)2000

Expected

2200





1
Expert's answer
2021-11-18T15:21:28-0500
<script>
    let p = parseInt(prompt())
    let t = parseInt(prompt())
    let a = parseInt(prompt())
    const foo = (p, t, a) => {
        let finalValue = p*(1+t*a/100);
        return finalValue;
    }
    alert(foo)
</script>

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