Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function braceletStand(input) {
- let dayCash = Number(input[0]) * 5;
- let dayProfit = Number(input[1]) * 5;
- let cost = Number(input[2]);
- let giftPrice = Number(input[3]);
- let total = dayCash + dayProfit - cost;
- if(total >= giftPrice){
- console.log(`Profit: ${total.toFixed(2)} BGN, the gift has been purchased.`)
- } else{
- console.log(`Insufficient money: ${(giftPrice - total).toFixed(2)} BGN.`)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement