0 added
0 removed
Original
2026-01-01
Modified
2026-03-09
1
<ul><li>script.js</li>
1
<ul><li>script.js</li>
2
</ul><p>JavaScript</p>
2
</ul><p>JavaScript</p>
3
<p>var totalPages = 6; // Total number of pages var consumptionTotal = 0; // Total toner consumption var consumptionPerPage = 70; // Toner consumption per page for (var page = 1; page <= totalPages; page++) { muffin.print(page); // Add the check here consumptionTotal += consumptionPerPage; console.log(consumptionTotal); }</p>
3
<p>var totalPages = 6; // Total number of pages var consumptionTotal = 0; // Total toner consumption var consumptionPerPage = 70; // Toner consumption per page for (var page = 1; page <= totalPages; page++) { muffin.print(page); // Add the check here consumptionTotal += consumptionPerPage; console.log(consumptionTotal); }</p>
4
<p>Thanks! We’ll fix everything at once!</p>
4
<p>Thanks! We’ll fix everything at once!</p>
5
<h2>Result</h2>
5
<h2>Result</h2>
6
<ol><li>After the consumptionPerPage variable, create variable economyMode, which contains false.</li>
6
<ol><li>After the consumptionPerPage variable, create variable economyMode, which contains false.</li>
7
<li>In the loop after calling muffin.print(), add a condition that works if economyMode equals true and if the number of the current page page is greater than 3.</li>
7
<li>In the loop after calling muffin.print(), add a condition that works if economyMode equals true and if the number of the current page page is greater than 3.</li>
8
<li>Inside this condition, increase consumptionTotal by consumptionPerPage * 0.5 with the help of the += operator.</li>
8
<li>Inside this condition, increase consumptionTotal by consumptionPerPage * 0.5 with the help of the += operator.</li>
9
</ol>
9
</ol>