Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function shopping(input){
- let timeForRelax = Number(input.shift());
- let periferyPrice = Number(input.shift());
- let programmPrice = Number(input.shift());
- let frapePrice = Number(input.shift());
- let timeLeft = timeForRelax - 5;
- let timePerifery = 3 * 2;
- let timeProgramm = 2 * 2
- let timeLeftForRelax = timeLeft - (timePerifery + timeProgramm)
- let sumPerifery = 3 * periferyPrice
- let sumProgramm = 2 * programmPrice
- let totalSum = sumPerifery + sumProgramm + frapePrice
- console.log(`${totalSum.toFixed(2)}`)
- console.log(`${timeLeftForRelax}`)
- }
- shopping([35,
- 2.50,
- 1.20,
- 6.30
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement