Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function shopping(input){
  2.  
  3.     let timeForRelax = Number(input.shift());
  4.     let periferyPrice = Number(input.shift());
  5.     let programmPrice = Number(input.shift());
  6.     let frapePrice = Number(input.shift());
  7.  
  8.     let timeLeft = timeForRelax - 5;
  9.     let timePerifery = 3 * 2;
  10.     let timeProgramm = 2 * 2
  11.     let timeLeftForRelax = timeLeft - (timePerifery + timeProgramm)
  12.     let sumPerifery = 3 * periferyPrice
  13.     let sumProgramm = 2 * programmPrice
  14.     let totalSum = sumPerifery + sumProgramm + frapePrice
  15.  
  16.     console.log(`${totalSum.toFixed(2)}`)
  17.     console.log(`${timeLeftForRelax}`)
  18. }
  19.  
  20. shopping([35,
  21.     2.50,
  22.     1.20,
  23.     6.30
  24.    
  25.    
  26.    
  27.    
  28.    
  29.     ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement