Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

3 How the market system answers four fundamental questions.

Answered: 1 week ago