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 Local Development Environments Advanced Tooling Finishing TreeStory

Teamwork TODO's

I watched the Teamwork video, but it went so fast I couldn't follow it. Could somebody help me with this challenge? I imported the treestory files into the IDE but I couldn't figure out what to do in main.java.

com/teamtreehouse/Main.java
// After you've completed the TODOs locally paste Main.java here
com/teamtreehouse/Prompter.java
// After you've completed the TODOs locally paste Prompter.java here
pseudo-tests.md
#  This is essentially what I am testing 
1.  The user is prompted for a new string template (the one with the double underscores in it).

  a. The prompter class has a new method that prompts for the story template, and that method is called.

2.  The user is then prompted for each word that has been double underscored.

   a. The answer is checked to see if it is contained in the censored words.
      User is continually prompted until they enter a valid word

3.  The user is presented with the completed story

2 Answers

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,702 Points

So I spent about 6-7 hours working this code to get it to pass. Not really complaining, the challenge of it was fun.

But I will tell you that this thing was a real doozy but I learned quite a bit in the process. I kept running into a few types of errors with how I originally had coded it out. 1 of them was a NullPointException and the other was telling me that I wasn't displaying the TreeStory. Except it all worked and ran just fine in my IDE with regular strings and empty values. Though it seems as if the Challenge passes in null values and if you aren't properly throwing and catching exceptions or account for possible null values, it will never pass.

Let me know what you have issues on or which parts you have troubles with and I will try to walk you through what I did. I saved my code in my IDE.

Cant wait for JavaFX

Chris Howell
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Chris Howell
Python Web Development Techdegree Graduate 49,702 Points

Essentially what you are doing is importing the project files (which you did). Then you are going to look for the TODOs that start like this.

// TODO:csd -

Everywhere there is a TODO is a place that code needs to be added. This is to "simulate" that you are working in a team. Craig had other things to do, so he "passed the code to you" with TODO comments. So he wants you to fill the code that should go with what the comments are asking. Such as:

// TODO:csd - Instantiate a new Prompter object and prompt for the story template

So I am going to write the code that will "instantiate a new Prompter object for the story template. To "instantiate" a new object partly looks like so:

Prompter prompter = new Prompter(); //passing in any arguments it may take.

I haven't gotten to this section or completed this part of this course yet, but I am almost there. I dont know if this answers your question entirely? Or if you were more leaning towards how to start actually coding out the commented TODOs?