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

I just don't get this question. Where should I get the code.

I think I don't understand the question in the first place, that is why I can't think of anything. I feel because of my English language that I don't understand it? this is really confusing?. I tried different combinations.

3 Answers

Stephen Bone
Stephen Bone
12,359 Points

Hi Botan

So in loose pseudocode/english the statement should read:

while remainingTries is greater than 0 and not dunkTank.isDunked

Hope it helps!

Stephen

Harry James
Harry James
14,780 Points

A bit off-topic here but thought I'd celebrate as I found someone else from Newcastle upon Tyne! hi-fives for the programming community up north!

Thanks for your answer, with your response I can easily code it in Java, but for some reason I couldn't get the question.

Stephen Bone
Stephen Bone
12,359 Points

I take it you got it resolved now by your response to Harry's post?

Well, if you mean how I answered , here is my answer :

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

}

I am taking Android Track, I wasn't able to go further because of this question. Your answer helped me to finish this quiz as well.

Stephen Bone
Stephen Bone
12,359 Points

Great, glad I could help!

Josh Gold
Josh Gold
12,207 Points

Thanks Stephen, now I understand what this question is asking us to do!

Harry James
Harry James
14,780 Points

Hey Botan!

I'll try and rephrase it for you:


We want to make sure throwBall() only runs if the user has tries remaining and the dunk tank hasn't been dunked yet.


You'll need to use a few symbols here to complete it!

Best of luck and if you still don't understand it, give me a shout :)

I was able to figure it out using ">, &&, !" . your explanation was great. Thanks. I solved it.

Well the question is based on the MVP video just before the quiz.

If you would have watch it carefully you will realise there is a remaining time while loop that the instructor explains

Just realized I gave away the code :) .. Steals away the fun in that case.

Hope it explains

Thanks Stephen, your answer helped a lot to understand it completely.