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![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Troy Taylor](https://secure.gravatar.com/avatar/513b49fbd940032818be85ec49500716?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Troy Taylor
Courses Plus Student 160 Pointshave hard coded age restriction but when I run program is does not restrict it why?
//Name is a adjective noun. They are always adverb verb. int age = 12; if (age < 13) { //Insert exit code console.printf ("Sorry u must be at least 12 to use this program.\n") System.Exit(0);
}
String name = console.readLine("Enter a name: "); String adjective = console.ReadLine("Enter an adjective: "); String noun = console.readLine ("Enter a noun: "); String adverb = console.readLine (" Enter an adjective String verb = console.readLine ("Enter a verb ending with in -ing: "); console.printf ("Your TreeStory:---------\n"); console.printf ("%s is a %s %s. ", name, adjective, noun); console.printf ("hey are always %s %s.\n", adverb, verb);
2 Answers
![Yanuar Prakoso](https://secure.gravatar.com/avatar/b629c57b15ad53afe24e8da9549b96df?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Yanuar Prakoso
15,196 PointsHi Troy
I really wish and recommend that you use the forum's Markdown Cheatsheet link and follow its' instruction when posting your question so that others will understand your situation much clearer.
//Name is a adjective noun. They are always adverb verb. int age = 12; if (age < 13) { //Insert exit code console.printf ("Sorry u must be at least 12 to use this program.\n") System.Exit(0);
The source of your problem most possible is in here but I cannot say for sure because as you can see you wrote it or paste it in line. If this is how you actually wrote your code it is possible that one of the code is treated as comments since you use // .
Please click the Markdown Cheatsheet below your post text box before you post the question. Better yet please re-post the question after you read it. Thank you and happy coding.
![Kelly Pepper](https://secure.gravatar.com/avatar/6b5a7ea636b2a5d1f26bbb779b7ecb71?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Kelly Pepper
197 PointsYou're missing a semicolon after your "Sorry u must be 13" in the if statement.
Troy Taylor
Courses Plus Student 160 PointsTroy Taylor
Courses Plus Student 160 Pointswhen I run command clear && Java TreeStory.java && Java TreeStory it says javac command not found