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

Piyush Patel
Piyush Patel
17,253 Points

Is there anyone who can help me with this vague question?

I'm stuck at this question and it does not allow me to finish the course.

Okay, so we have a code version of a carnival based Dunk Tank. As long as the there are tries remaining and the tank has not been dunked, throw the ball.

Please fill in the blanks with proper code for the while loop (you might need to scroll).

```while (remainingTries ______ 0 ______ ______

dunkTank.isDunked()) { throwBall(); }```

What should I do in this??? I tried different things like,

=, ), { =, ) { , remainingTries--;

But don't know which one is right??

Please, help me! Thanks in advance.

2 Answers

Simon Coates
Simon Coates
28,694 Points

it's

while (remainingTries > 0 && !dunkTank.isDunked()) {
  throwBall();
}
Piyush Patel
Piyush Patel
17,253 Points

Thanks Simon for your help!