Let us know when you have wrapped your code in code tags.
Printable View
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.
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 testingQuote:
What number of bottles?
There could be an error in your logic. The option will show it.