Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve (data) {
- let budget = Number(data[0]);
- let season = data[1];
- // Bulgaria , Balkans , Europe
- let Bulgaria = 'Bulgaria'
- let Balkans = 'Balkans'
- let Europe = 'Europe'
- let Camp = 'Camp'
- let Hotel = 'Hotel'
- let discount = 0;
- if (budget <= 100) {
- if(season == 'summer') {
- budget = budget * 0.30;
- console.log(`Somewhere in ${Bulgaria}`)
- console.log(`${Camp} - ${budget.toFixed(2)}`)
- } else if (season == 'winter') {
- budget = budget * 0.70;
- console.log(`Somewhere in ${Bulgaria}`)
- console.log(`${Hotel} - ${budget.toFixed(2)}`)
- }
- } else if (budget <= 1000) {
- if(season == 'summer') {
- budget = budget * 0.40;
- console.log(`Somewhere in ${Balkans}`)
- console.log(`${Camp} - ${budget.toFixed(2)}`)
- } else if (season == 'winter') {
- budget = budget * 0.80;
- console.log(`Somewhere in ${Balkans}`)
- console.log(`${Hotel} - ${budget.toFixed(2)}`)
- }
- } else if (budget > 1000) {
- budget = budget * 0.90;
- console.log(`Somewhere in ${Europe}`)
- console.log(`${Hotel} - ${budget.toFixed(2)}`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment