Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Java

Alin Stanescu
Alin Stanescu
15,793 Points

Hy...does anyone know what the correct answer is for this question: http://teamtreehouse.com/library/java-objects/delive

No proper explanations...Confusing!!

Craig Dennis
Craig Dennis
Treehouse Teacher

What is the problem you are having? If you use Ask Question from the code challenge it will share your code, and then you can clarify what you aren't understanding.

Ken Alger
Ken Alger
Treehouse Teacher

Alin;

I would have to concur with Mr. Dennis. If you can provide some additional information about your specific question, I am sure someone will be able to assist.

Ken

Alin Stanescu
Alin Stanescu
15,793 Points

Fill in the blank below.

Okay, so we have a code version of a carnival based Dunk Tank. Please fill in the blanks with proper code for the while loop.

while (remainingTries __________ 0 _________ _____________ dunkTank.isDunked()) { throwBall(); }

Any Idea what to put in the 3 empty spots to make the loop work?

2 Answers

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

Try this I am sure it works. The aim of the code is to stop throwing the ball when the remaining tries is zero and when the dunk tank is dunked hence the '!' is used. Hope this helps. Please tell me if it helps.

JAVIER GARCIA
JAVIER GARCIA
9,176 Points

Why != 0 && ! is a wrong answer?