Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function footballKit(input) {
- let shirtPrice = Number(input[0]);
- let sum = Number(input[1]);
- let shortsPrice = shirtPrice * 0.75;
- let socksPrice = shortsPrice * 0.20;
- let sneakersPrice = (shirtPrice + shortsPrice) * 2;
- let price = (shirtPrice + shortsPrice + socksPrice + sneakersPrice) * 0.85;
- if (sum > price) {
- console.log("No, he will not earn the world-cup replica ball.");
- console.log(`He needs ${(sum - price).toFixed(2)} lv. more.`);
- } else {
- console.log("Yes, he will earn the world-cup replica ball!");
- console.log(`His sum is ${price.toFixed(2)} lv.`);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement