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));
Comments
Leave a comment