Objectives |
Students use a for loop to
solve a counted loop problem. |
Background |
There is a travel song, 100 bottles of “pop” on the wall. (See the verse below.) Your task is to implement a program that will “sing” a few verses of the “bottles of pop” song. (You may substitute your favorite libation but in the interest of our underage population, the libation should be non-alcoholic.) |
New Terms |
|
Materials |
You
will write BottlesOfPop.java from scratch. |
Submission |
|
Acknowledgment |
Adapted
from an original lab by Arch Harris & Nancy Harris |
The verses of a song look like this:
100
bottles of pop on the wall
100 bottles of pop
If one of those bottles should happen to fall
99 bottles of pop
on the wall
next verse
99
bottles of pop on the wall
… etc until
0 bottles of pop on the wall
Part
4 - Implement the basic solution - singing the song from
a number of the user's choice to 0
TEST each step before moving on to the next.
Part 5 - Implementing a more complex
solution - singing only a few verses of the song
95 bottles of pop on the wall
as the
last line. (Optional)
Part 6 - Refinement
updated 10/16/2012 - NLH
updated 10/18/2012 - CSM