The second part of the assignment is to write a program that will print out the lyrics to 99 Bottles. Bottles of what? Make a variable for what is in the bottle (so it can be easily changed) and start it out as “beer” or another beverage of your choice, if you’d rather.
You will also want to have a variable for the initial number of bottles, as it gets tedious to scroll through 99 verses each time. I recommend working with this set to 3 for starter, then changing it to 99 when you have everything working. Remember to update this, as I am expecting 99 Bottles, not 3 Bottles...
Your job is to write a command line program in Java that prints the song lyrics, nicely formatted as follows:
99 bottles of beer on the wall.
99 bottles of beer!
Take one down. Pass it around.
98 bottles of beer on the wall.
98 bottles of beer on the wall.
98 bottles of beer!
Take one down. Pass it around.
97 bottles of beer on the wall.
... and so on until ...
2 bottles of beer on the wall.
2 bottles of beer!
Take one down. Pass it around.
1 bottle of beer on the wall.
1 bottle of beer on the wall.
1 bottle of beer!
Take one down. Pass it around.
No more bottles of beer on the wall.
Be very careful with the singular / plural of the word bottle(s) as it appears in the lyrics. There are two things I am looking for in this assignment:
- Can you use a loop to control the number of times code is run
- Can you use that loop counter to alter the program behavior
You want to keep an eye on the number of bottle to get the correct singular or plural format of the word bottle, and you also need to alter that last line of the verse when we run out of bottles.
While this may seem a trivial or silly assignment at first, using a loop counter and altering program behavior based on the value of that counter is a very common requirement in many programs. So pay attention to the details here and write the most elegant code that you can to solve this seemingly silly assignment.
Repository: https://github.com/htc-ccis2595/counting-game
You need to fork this repository and submit a pull request to turn in the assignment. Again, please post a screenshot of the pull request to the D2L dropbox. There will be only one D2L dropbox for both parts of the assignment, so both screenshots will go to the same place.