logo CodeStepByStep logo

ProcessName2

Language/Type: Java input Scanner
Related Links:

Modify your solution to the previous ProcessName exercise so that it re-prompts until the user types a name that is at least 5 letters total in length and has at least one space in it. For example:

Type your name: Joe
Error, must be at least 5 chars with a space.
Type your name: O K!
Error, must be at least 5 chars with a space.
Type your name: what
Error, must be at least 5 chars with a space.
Type your name: Tyler Durden
Your name is: Durden, T.
Bare code: Write a fragment of Java code as described, without any class or function/method heading around your code.

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.