Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function careOfPuppy(input) {
- let food = Number(input[0]);
- let totalFood = 0;
- let foodInGrams = food * 1000;
- totalFood = 130 + 345 + 400 + 180 + 230 + 120;
- for (i = 1; i === "Adopted"; i ++) {
- }
- if (foodInGrams >= totalFood) {
- console.log(`Food is enough! Leftovers: ${(foodInGrams - totalFood)} grams.`);
- } else {
- console.log(`Food is not enough. You need ${(totalFood - foodInGrams)} grams more.`);
- }
- }
- careOfPuppy(["4", "130", "345", "400", "180", "230", "120", "Adopted"]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement