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 trialBotan Abdullah
Courses Plus Student 2,940 PointsI 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
12,359 PointsHi 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
14,780 PointsHey 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 :)
Botan Abdullah
Courses Plus Student 2,940 PointsI was able to figure it out using ">, &&, !" . your explanation was great. Thanks. I solved it.
Gunjeet Hattar
14,483 PointsWell 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
Botan Abdullah
Courses Plus Student 2,940 PointsThanks Stephen, your answer helped a lot to understand it completely.
Harry James
14,780 PointsHarry James
14,780 PointsA 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!
Botan Abdullah
Courses Plus Student 2,940 PointsBotan Abdullah
Courses Plus Student 2,940 PointsThanks 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
12,359 PointsStephen Bone
12,359 PointsI take it you got it resolved now by your response to Harry's post?
Botan Abdullah
Courses Plus Student 2,940 PointsBotan Abdullah
Courses Plus Student 2,940 PointsWell, 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
12,359 PointsStephen Bone
12,359 PointsGreat, glad I could help!
Josh Gold
12,207 PointsJosh Gold
12,207 PointsThanks Stephen, now I understand what this question is asking us to do!