0
Please help me solve problem
Jack decided to save 15% on every paycheck. This program takes the amount of the salary as input. End the function to calculate and output the accumulated sum. Sample input 200 Result example 30 //node.js: function main() { var salaryAmount = parseInt(readLine(), 10); // end calling function getSavings(); } //end function function getSavings() { }; https://code.sololearn.com/cOw7kP35Nd6u/?ref=app
4 Réponses
+ 1
console.log(salaryAmount * .15)
put this at the end calling function. Leave //end function alone.
+ 6
You haven't passed the salary amount in function!!
+ 3
Dmitriy Plotnikov
I think it's very simple. Just pass the salaryAmount in function and calculate 15% of salaryAmount.
+ 2
function main() {
var salaryAmount = parseInt(readLine(), 10);
// завершите вызов функции
getSavings(salaryAmount );
}
//завершите функцию
function getSavings(salaryAmount ) {
console.log(salaryAmount / 100 * 15)
};