subject

Write a program that outputs the lyrics for "ninety-nine bottles of beer on the wall." your program should print the number of bottles in english, not as a number. for example: ninety-nine bottles of beer on the wall, ninety-nine bottles of beer, take one down, pass it around, ninety-eight bottles of beer on the wall. one bottle of beer on the wall, one bottle of beer, take one down, pass it around, zero bottles of beer on the wall. your program should not use ninety-nine output statements! design your program with a class named beersong whose constructor takes an integer parameter that is the number of bottles of beer initially on the wall. if the parameter is less than zero, set the number of bottles to zero. similarly, if the parameter is greater than 99, set the number of beer bottles to 99. then make a public method called printsong that outputs all stanzas from the number of bottles of beer down to zero. add any additional private methods you find . hint: stanzas are all same, only a number of bottles is different. use method to form your stanzas. you can see the lyrics for the song here (links to an external

ansver
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 02:50, bfell92
There’s only one game mode that stars with the letter ‘e’ in cs: go. which of the options below is it?
Answers: 1
image
Computers and Technology, 23.06.2019 03:50, nakeytrag
Iam a bacterium. i cause stomach cramps and diarrhea. i am caused by eating rotten foodssuch as chicken, fish, or eggs. sometimes turtles carry my bacteria. what am i?
Answers: 2
image
Computers and Technology, 24.06.2019 00:50, anthonycraig0205
3. what is the output of the following statements? temporary object1; temporary object2("rectangle", 8.5, 5); temporary object3("circle", 6, 0); temporary object4("cylinder", 6, 3.5); cout < < fixed < < showpoint < < setprecision(2); object1.print(); object2.print(); object3.print(); object4.print(); object1.set("sphere", 4.5, 0); object1.print();
Answers: 1
image
Computers and Technology, 24.06.2019 10:30, johngayden46
This device directs network traffic. bridge hub nic repeater router switch
Answers: 3
You know the right answer?
Write a program that outputs the lyrics for "ninety-nine bottles of beer on the wall." your program...

Questions in other subjects:

Konu
Mathematics, 04.10.2021 16:00