“Spend After Saving”: Function Parameters | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 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!

11th Jan 2022, 3:43 AM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
4 Réponses
+ 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) }
11th Jan 2022, 4:09 AM
Simba
Simba - avatar
+ 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.
11th Jan 2022, 4:31 AM
Simba
Simba - avatar
+ 2
Simba Unbelievable. Why did “save” work and not (salary) or getSavings? Also, thanks a million for this.
11th Jan 2022, 4:19 AM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar
+ 2
Ok. Thanks again Simba . That’s very helpful. 😁
11th Jan 2022, 4:34 AM
Tahiti🌍Castillo
Tahiti🌍Castillo - avatar