ExGiX

Untitled

Feb 10th, 2020
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. function solve (data) {
  2.  
  3. let budget = Number(data[0]);
  4. let season = data[1];
  5.  
  6. // Bulgaria , Balkans , Europe
  7.  
  8. let Bulgaria = 'Bulgaria'
  9. let Balkans = 'Balkans'
  10. let Europe = 'Europe'
  11. let Camp = 'Camp'
  12. let Hotel = 'Hotel'
  13. let discount = 0;
  14.  
  15. if (budget <= 100) {
  16.  
  17. if(season == 'summer') {
  18.  
  19.  
  20. budget = budget * 0.30;
  21. console.log(`Somewhere in ${Bulgaria}`)
  22. console.log(`${Camp} - ${budget.toFixed(2)}`)
  23.  
  24. } else if (season == 'winter') {
  25.  
  26. budget = budget * 0.70;
  27.  
  28. console.log(`Somewhere in ${Bulgaria}`)
  29. console.log(`${Hotel} - ${budget.toFixed(2)}`)
  30. }
  31.  
  32.  
  33. } else if (budget <= 1000) {
  34.  
  35. if(season == 'summer') {
  36.  
  37. budget = budget * 0.40;
  38. console.log(`Somewhere in ${Balkans}`)
  39. console.log(`${Camp} - ${budget.toFixed(2)}`)
  40.  
  41.  
  42. } else if (season == 'winter') {
  43.  
  44. budget = budget * 0.80;
  45.  
  46. console.log(`Somewhere in ${Balkans}`)
  47. console.log(`${Hotel} - ${budget.toFixed(2)}`)
  48.  
  49. }
  50.  
  51.  
  52. } else if (budget > 1000) {
  53.  
  54. budget = budget * 0.90;
  55.  
  56. console.log(`Somewhere in ${Europe}`)
  57. console.log(`${Hotel} - ${budget.toFixed(2)}`)
  58. }
  59.  
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment