Java Java Basics Perfecting the Prototype Reviewing Our Feedback

have 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);

when I run command clear && Java TreeStory.java && Java TreeStory it says javac command not found

1 Answer

Yanuar Prakoso
Yanuar Prakoso
15,191 Points

Hi 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.