Let us know when you have wrapped your code in code tags.
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Let us know when you have wrapped your code in code tags.
Edit your post and wrap your code with
[code=java]
<YOUR CODE HERE>
[/code]
to get highlighting
Yes, the formatting is better, but there are Way too many empty lines!!!
Can you explain what is wrong with the program's output. You've posted two outputs but didn't explain what was wrong with either of them in a clear way. Please explain what you want to be changed.
You need to add the -Xlint option for the compiler to see the possible error.
Last edited by Norm; March 12th, 2012 at 03:09 PM.
Oh ok. Um I just need the output to say:
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.
Ninety eight bottles of beer on the wall,
Ninety eight bottles of beer,
Take one down, pass it around,
Ninety seven bottles of beer on the wall.
The problem is that the numbers aren't going down. It's just repeating ninety nine the entire time. However, it shows a number before the whole phrase like:
ninety nine
ninety nine bottles of beer on the wall,
Ninety Nine bottles of beer,
Take one down, pass it around,
Ninety Nine bottles of beer on the wall.
ninety eight
Ninety Nine bottles of beer on the wall,
Ninety Nine bottles of beer,
Take one down, pass it around,
Ninety Nine bottles of beer on the wall.
I need the phrase itself to repeat while going down by 1 each time (i.e. seventy seven bottles of beer on the wall, take one down pass it around, seventy six bottles of beer on the wall). That's the problem.
For testing change the number of bottles to 19 and see what is output.
You need to add the -Xlint option for the compiler to see the possible error.
What number of bottles?
There is no error. It's just the wrong code.
BottleSong bs = new BottleSong(19); //<<<<<<<<< small number for testingWhat number of bottles?
There could be an error in your logic. The option will show it.