Advertisement
nikolayneykov92

Untitled

Jun 3rd, 2019
323
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve (fundamentals, advanced, applications, form) {
  2.   let total = 0
  3.  
  4.   if (fundamentals && advanced && applications) {
  5.     total = (170 + 180 * 0.9 + 190) * 0.94
  6.   } else if (advanced && fundamentals) {
  7.     total = 180 * 0.9 + 170
  8.   } else {
  9.     if (fundamentals) {
  10.       total += 170
  11.     }
  12.     if (advanced) {
  13.       total += 180
  14.     }
  15.     if (applications) {
  16.       total += 190
  17.     }
  18.   }
  19.  
  20.   if (form === 'online') {
  21.     total = total * 0.94
  22.   }
  23.  
  24.   console.log(Math.round(total))
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement