Question
COBOL PROGRAMMING: There is a song called 99 Bottles of Beer, Here are the lyrics: 99 Bottles of Beer on the Wall, 99 Bottles of
COBOL PROGRAMMING:
There is a song called "99 Bottles of Beer", Here are the lyrics:
99 Bottles of Beer on the Wall, 99 Bottles of Beer;
Take 1 down, pass it around, 98 Bottles of Beer on the Wall...
Then it repeats:
98 Bottles of Beer on the Wall, 98 Bottles of Beer;
Take 1 down, pass it around, 97 Bottles of Beer on the Wall...
The song repeats until the final verse:
1 Bottle of Beer on the Wall, 1 Bottles of Beer;
Take 1 down, pass it around, No More Bottles of Beer on the Wall...
No More Bottles of Beer on Wall, No More bottles of Beer...
Get the Hat and pass it around, time to B Double E Double R U-N, Beer Run...
Write a program to accept the number of starting beers on the wall from 1 to 99.
The program will write out the lyrics starting with the number of bottles specified.
This can be done with an in-line perform or the performing of a paragraph where the number of bottles is decremented and put into the verse for displaying.
The last verse is different as you can see.
The program should only accept a number from 1 to 99 and re-prompt the user to enter a valid number until correctly entered.
For an extra 20 points, specify the number of beers to take down from another user input and reduce the number on the wall until the number of bottles is less that that number, then the last verse is written.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started