Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (input) => {
- let type = input.shift(), vol = Number(input.shift()), hasCard = input.shift() === 'Yes';
- let prices = { 'Gasoline': hasCard ? 204 : 222, 'Diesel': hasCard ? 221 : 233, 'Gas': hasCard ? 85 : 93 };
- let money = prices[type] * vol * ( vol >= 20 && vol <= 25 ? 0.92 : vol > 25 ? 0.9 : 1);
- console.log(`${(money/100).toFixed(2)} lv.`);
- }
Advertisement
Add Comment
Please, Sign In to add comment