Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function trip([arg1, arg2]) {
- let budget = Number(arg1);
- let season = arg2;
- if (budget <= 100) {
- if (season == 'summer') {
- console.log('Somewhere in Bulgaria');
- console.log('Camp - ' + (30 / 100 * budget).toFixed(2));
- }
- if (season == 'winter') {
- console.log('Somewhere in Bulgaria');
- console.log('Hotel - ' + (70 / 100 * budget).toFixed(2));
- }
- } else if (budget <= 1000 && budget > 100) {
- if (season == 'summer') {
- console.log('Somewhere in Balkans');
- console.log('Camp - ' + (40 / 100 * budget).toFixed(2));
- }
- if (season == 'winter') {
- console.log('Somewhere in Balkans');
- console.log('Hotel - ' + (80 / 100 * budget).toFixed(2));
- }
- } else if (budget >= 10000) {
- console.log('Somewhere in Balkans');
- console.log('Hotel - ' + (90 / 100 * budget).toFixed(2));
- }
- }
- trip(['50', 'summer']);
- trip(['75', 'winter']);
- trip(['312', 'summer']);
- trip(['678.53', 'winter']);
- trip(['1500', 'summer']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement