Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Objects (Retired) Delivering the MVP Determining if it is Solved

J.D. Sandifer
J.D. Sandifer
18,813 Points

Unclear question about while loop...

Seems like you just need to insert the ">" for the comparison and a ")" and a "{" to close the comparison and open the loop code...but that doesn't work.

What's needed to correctly answer this question?

J.D. Sandifer
J.D. Sandifer
18,813 Points

I realized that we also need to decrement remainingTries.

However, ">", ") {", and remainingTries--; still doesn't work...

2 Answers

It is

while (remainingTries > 0 && !dunkTank.isDunked()) {

The window scrolls to the right which makes it all so much clearer!! The massive underlines need reducing in length to make that easier to see.

Steve.

The throwBall() will decrement remainingTries.

J.D. Sandifer
J.D. Sandifer
18,813 Points

There is no scrollbar for me so I had no idea...I saw nothing after the last blank.

Thanks for your help - it was much easier to answer after I saw the full question!

Hi J.D.

I agree, this isn't very clear at all. I've not done this course so am unaware of any context behind the question.

But, while I agree with your suggestion of adding the symbols you suggest, that leaves the dunkTank.isDunked bit out on a limb and with no trailing semicolon.

I'd love to know the answer to this!

Steve.