var numSheep = 4; var monthsToPrint = 12; for(var monthNumber = 1; monthNumber <= monthsToPrint; monthNumber++) { if (numSheep > 10000) { numSheep = numSheep / 2; console.log("Removing " + numSheep + " sheep from the population. Phew!"); } numSheep = numSheep * 4; console.log("There will be " + numSheep + " sheep after " + monthNumber + " month(s)!"); }