Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function result(buget, extras, price){
- buget = Number(buget);
- extras = Number(extras);
- price = Number(price);
- let decor = buget*0.1;
- let totalPrice;
- if (extras < 150 ){
- totalPrice = extras*price;
- }
- else if (extras >= 150 ){
- totalPrice = (extras*price)*0.9;
- }
- let bugetLeft = (buget) - (decor + totalPrice);
- if (buget > decor + totalPrice){
- console.log(`Action!
- Wingard starts filming with ${bugetLeft.toFixed(2)} leva left.`);
- }
- else if(buget < decor + totalPrice){
- console.log(`Not enough money!
- Wingard needs ${Math.abs(bugetLeft.toFixed(2))} leva more.`);
- }
- }
- result("20000",
- "120",
- "55.5")
- ;
Advertisement
Add Comment
Please, Sign In to add comment