Liliana797979

safari

Dec 22nd, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function safari(arg1, arg2, arg3) {
  2.     let budget = Number(arg1);
  3.     let litersOfFuels = Number(arg2);
  4.     let dayOfWeek = "";
  5.     let price = 0;
  6.  
  7.     if (dayOfWeek === "Saturday") {
  8.         totalPrice = totalPrice * 0.10;
  9.  
  10.     } else if (dayOfWeek === "Sunday"){
  11.         totalPrice = totalPrice * 0.20;
  12.     }
  13.  
  14.     price = litersOfFuels * 2.10;
  15.     let totalPrice = price + 100;
  16.  
  17.     if (budget >= totalPrice) {
  18.         console.log(`Safari time! Money left: ${(budget - totalPrice)} lv.`);
  19.  
  20.     } else if (budget < totalPrice) {
  21.         console.log(`Not enough money! Money needed: ${(totalPrice - budget)} lv.`);
  22.     }
  23. }
  24.  
  25. safari("120", "30", "Saturday");
Advertisement
Add Comment
Please, Sign In to add comment