Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function savings(a, b, c) {
- let incomePerMonth = parseFloat(a);
- let months = parseInt(b);
- let personalExpenses = parseFloat(c);
- let moneyLeft = incomePerMonth - personalExpenses - (incomePerMonth * 0.3);
- let maxPercent = ((moneyLeft / incomePerMonth) * 100).toFixed(2);
- let sum = (months * moneyLeft).toFixed(2);
- console.log(`She can save ${maxPercent}%`);
- console.log(sum);
- }
Add Comment
Please, Sign In to add comment