Ninety-nine bottles of beer on the wall

Assignment Help JAVA Programming
Reference no: EM132057210

Need 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 helpful.

Reference no: EM132057210

Questions Cloud

Convert the percent to a fraction : Your program should then convert the percent to a fraction, such as 0.056, and should use a loop to estimate the price adjusted for inflation.
Java android mobile applications : Java is used in Android development. Is thread safety as important in Java Android mobile applications?
Encapsulate the definition of user defined data types : One important difference between languages that provide syntax to encapsulate the definition of user defined data types
Sql injection is a common security problem : SQL Injection is a common security problem. It often stems from concatenation of SQL query parameters.
Ninety-nine bottles of beer on the wall : Need 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
What are 3 ways to improve a program : What are 3 ways to improve a program? These improvements should be related to the use of thread.
Containing integers sorted in ascending order : You are given a list, L , and a another list, P, containing integers sorted in ascending order.
Make a main method that will accomplish the following steps : Make a main method that will accomplish the following steps. (You may assume that the class includes all appropriate setter methods and getter methods)
Make a java class called sequence : Make a Java class called Sequence which prompts the user for a single integer value called n, and reports the sequence of integers generated by the following

Reviews

Write a Review

JAVA Programming Questions & Answers

  Write a method which reverses the order of items

Write a method static void reverse (List l) which reverses the order of items stored in the list. Again, make sure it works for any special cases you can think of - write a series of statements to create several AList and/or LList objects (of typ..

  Write a program that asks for the speed of a vehicle

Write a program that asks for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled.

  Write a java application that reads a file containing text

Write a Java application that reads a file containing text. Your program should read each line and display it on the console screen preceded by line numbers. If the input file is:

  Create a japplet

Create a JApplet that contains a JLabel and JButton. You'll create a JButton that will automatically change font typeface, style, and size when clicked by the user.

  Pass in the number of gallons on board

public float usefulLoad() // this is the grossWeight - emptyWeight public float usefulLoadWithFuel( in gallons ) // this is the useful load - gallons x 6. The programmer user will pass in the number of gallons on board.

  Write program to keep track of a hardware stores inventory

Write a program to keep track of a hardware store's inventory. The store sells various items. For each item in the store, the following information is kept: item ID, item name, number of pieces in stock, manufacturer's price of the item, and the s..

  Eax contains the given contents before the instruction

For each add instruction in this problem, assume that EAX contains the given contents before the instruction is executed, and give the contents of EAX as well as the values of the CF, OF, SF, and ZF flags after the instruction is executed:

  What was in mind of the coder in each part of the code

Need a video that goes through all this java code - as if it was a tutorial showing it line by line - and explain in detail the structure of it all as if you code it yourself.

  Create a hotel management web application

CSCE 464/864 - Spring 2016 - Create a hotel management web application that can be used by two types of users: customers and clients. A customer is a user who intends to search for hotels and make reservations.

  Client server chat system

Threading and GUI design using Java's network library, threading system, and swing user interlace libraries to implement a basic chat client and saver system. Thc system will allow multiple. remote users to send and receive messages across the net..

  Provide a regular expression that shows the set of strings

Provide a regular expression that shows the set of strings over {a, b} thatcontain at least one b if its length is at least four.

  Supply constructor that makes polynomial from a single term

Supply methods to add, multiply, and print polynomials - Need help with the assignment

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd