Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Change the program so that it correctly handles one bottle of beer. It should re

ID: 3621114 • Letter: C

Question

Change the program so that it correctly handles one bottle of beer. It should read 1 bottle of beer on the wall. and not 1 bottles of beer.

// Variables
var count; // numeric

// Main Program
count = parseFloat(prompt(“How many bottles?”,0));
while ((count > 0))
{
document.write(count);
document.writeln(“ bottles of beer on the wall,”);
document.write(count);
document.writeln((“ bottles of beer,”);
document.write(“Take one down. pass it around);
count = count - 1
document.write(count);
document.writeln(“ bottles of beer on the wall,”);
document.writeln(“ “);
}

Explanation / Answer

Dear.. var count; // numeric // Main Program count = parseFloat(prompt("How many bottles?",0)); while ((count > 1)) { document.writeln(count ," bottles of beer on the wall,"); document.writeln(count ," bottles of beer,
"); document.write("Take one down. pass it around
"); count = count - 1 document.writeln(" "); } if(count
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote