+ 1
“Spend After Saving”: Function Parameters
https://code.sololearn.com/cfRYCYS4h2pG/?ref=app I’ve tried numerous ways, but haven’t figured this one out. Functions 25.3. Please help!
4 ответов
+ 7
//try this
function main() {
let salary= parseInt(readLine(), 10);
// complete the function call
getSavings(salary)
}
//complete the function
function getSavings(salary) {
save= salary * .15;
console.log(save)
}
+ 6
Everything should work. You could just try them.
All you need a variable to assign a value(salary*.15)
Here, you just missed console.log() to print the output.
+ 2
Simba Unbelievable. Why did “save” work and not (salary) or getSavings?
Also, thanks a million for this.
+ 2
Ok. Thanks again Simba . That’s very helpful. 😁