Advertisement
galink

Untitled

Jul 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function trip([arg1, arg2]) {
  2.     let budget = Number(arg1);
  3.     let season = arg2;
  4.  
  5.     if (budget <= 100) {
  6.         if (season == 'summer') {
  7.             console.log('Somewhere in Bulgaria');
  8.             console.log('Camp - ' + (30 / 100 * budget).toFixed(2));
  9.         }
  10.         if (season == 'winter') {
  11.             console.log('Somewhere in Bulgaria');
  12.             console.log('Hotel - ' + (70 / 100 * budget).toFixed(2));
  13.         }
  14.     } else if (budget <= 1000 && budget > 100) {
  15.         if (season == 'summer') {
  16.             console.log('Somewhere in Balkans');
  17.             console.log('Camp - ' + (40 / 100 * budget).toFixed(2));
  18.         }
  19.         if (season == 'winter') {
  20.             console.log('Somewhere in Balkans');
  21.             console.log('Hotel - ' + (80 / 100 * budget).toFixed(2));
  22.         }
  23.  
  24.     } else if (budget >= 10000) {
  25.         console.log('Somewhere in Balkans');
  26.         console.log('Hotel - ' + (90 / 100 * budget).toFixed(2));
  27.     }
  28.  
  29. }
  30.  
  31. trip(['50', 'summer']);
  32. trip(['75', 'winter']);
  33. trip(['312', 'summer']);
  34. trip(['678.53', 'winter']);
  35. trip(['1500', 'summer']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement