To solve a simple programming problem with Java, and to make sure you have a working Java environment with IntelliJ.
Your task for this lab is to write a program to generate the lyrics to the song "99 Bottles of Beer". However, your program should read in the starting number of bottles the user wants in the song, it won't always be 99.
Also, you should read in the user's favorite beverage to use in the lyrics, instead of just using "beer" — some users may not be 21 (or indeed like beer).
Here is an example run of the program, so you can see how the program should work, and to see the lyrics to the song in case you're not familiar with them:
How many bottles to start with? 5 What is your favorite beverage? iced tea 5 bottles of iced tea on the wall, 5 bottles of iced tea. Take one down and pass it around, 4 bottles of iced tea on the wall. 4 bottles of iced tea on the wall, 4 bottles of iced tea. Take one down and pass it around, 3 bottles of iced tea on the wall. 3 bottles of iced tea on the wall, 3 bottles of iced tea. Take one down and pass it around, 2 bottles of iced tea on the wall. 2 bottles of iced tea on the wall, 2 bottles of iced tea. Take one down and pass it around, 1 bottle of iced tea on the wall. 1 bottle of iced tea on the wall, 1 bottle of iced tea. Take one down and pass it around, 0 bottles of iced tea on the wall. 0 bottles of iced tea on the wall, 0 bottles of iced tea. Go to the store and buy some more, 5 bottles of iced tea on the wall.
When you are finished, please submit the .java file (and not the .class or other files) for the lab on Canvas.
Copyright © 2022 Ian Finlayson | Licensed under a Attribution-NonCommercial 4.0 International License.