Question: In the spirit of the Old MacDonald page you wrote in Chapter 9, create a Web page named bottles.html that displays verses of the song

In the spirit of the "Old MacDonald" page you wrote in Chapter 9, create a Web page named bottles.html that displays verses of the song "100 bottles of Root Beer on the Wall" (you may insert your favorite beverage). The page should contain a text box in which the user can enter the initial number of bottles. You should also provide a button that, when clicked, calls a function to display (in a page division) the sequence of verses starting with the specified number of bottles. For example, if the user entered the number 100, your page might display:

100 bottles of root beer on the wall.

100 bottles of root beer.

Take one down, pass it around.

99 bottles of root beer on the wall.

99 bottles of root beer on the wall.

99 bottles of root beer.

Take one down, pass it around.

98 bottles of root beer on the wall.

...

1 bottle of root beer on the wall.

1 bottle of root beer.

Take one down, pass it around.

0 bottles of root beer on the wall.

[The variable that drives your loop test should be initialized to the number of bottles entered by the user and then decremented during each iteration of the loop. Within the loop body, include statements that display the verse associated with the variable's current value.]

Step by Step Solution

3.48 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

1409-C-S-O-S(1087).docx

120 KBs Word File

Students Have Also Explored These Related Operating System Questions!