Question: Write a program that prints the first few verses of the traveling song One Hundred Bottles of Beer. Use a loop such that each prints

 Write a program that prints the first few verses of the

Write a program that prints the first few verses of the traveling song "One Hundred Bottles of Beer." Use a loop such that each prints one verse. Read the number of verses to print from the user. Validate the input The following are the first two verses of the so 100 bottles of beer on the wall 100 bottles of beer If one of those bottles should happen to fall 99 bottles of beer on the wall 99 bottles of beer on the wall 99 bottles of beer If one of those bottles should happen to fall 98 bottles of beer on the wall A scanner object for input A variable to store the number of verses Two loops: 1. One to perform input validation 2. The other to adjust the verses for each iteration Comments for appropriate documentation A sample of the output is shown below: How many verses (1 to 100)? -3 How many verses (1 to 100)? 3 100 bottles of beer on the wall. 100 bottles of beer. If one of those bottles should happen to fall 99 bottles of beer on the wall. 99 bottles of beer on the wall. 99 bottles of beer. If one of those bottles should happen to fall 98 bottles of beer on the wall. 98 bottles of beer on the wall. 98 bottles of beer. If one of those bottles should happen to fall

Step by Step Solution

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

Students Have Also Explored These Related Databases Questions!