Advertisement
Spocoman

08. Pet Shop

Aug 22nd, 2024
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function petShop(input) {
  2.     let dogFoodPrice = 2.50;
  3.     let catFoodPrice = 4.00;
  4.    
  5.     let dogFoodCount = Number(input[0]);
  6.     let catFoodCount = Number(input[1]);
  7.  
  8.     let totalPrice = dogFoodPrice * dogFoodCount + catFoodPrice * catFoodCount;
  9.  
  10.     console.log(totalPrice + ' lv.');  
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement