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 trialwilliamblayney
973 PointsIt does not exit the program after saying your too young to use the program
int age = 12;
if (age < 13) {
//Insert Exit Code
console.printf("Sorry; you must be at least 13 to use this program.\n");
System.exit(0);
}
Was my code... but it won't exit the program after the Sorry; you must be at least 13 to use this program
3 Answers
Kristian Terziev
28,449 PointsCould you please post your code like that:
//empty line
(3 times the symbol under the escape)
//code
(3 times the symbol under the escape)
//empty line
So it's easier to read. Thanks :)
Brad Massengale
2,448 PointsThat code is perfect. It won't actually tell you that it's exiting unless you make it. Is it going on to the program anyway? If not, it's working.
williamblayney
973 PointsSorry; you must be at least 13 to use this program.
Enter an adjective: www
Enter a noun: www
Enter an adverb: www
Enter a verb ending with -ing: wwwing
Your TreeStory:
www is a www www. They are always www wwwing.
Ken Alger
Treehouse TeacherCan you post your entire code so we can take a look? Sometimes it is something rather small that makes a huge difference.
When posting, please follow the Markdown Cheatsheat referenced below the text box for posting your code.
Thanks,
Ken
Ken Alger
Treehouse TeacherKen Alger
Treehouse TeacherEdited for markup