Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.

QUESTION

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

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: JoeError, 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: whatError, must be at least 5 chars with a space.Type your name: Tyler DurdenYour name is: Durden, T.Bare code: For this problem, you are supposed to just submit a fragment of Java code as described. You should not write any class or method heading around your code; just write the lines of code that will produce the result described.Scanner console = new Scanner(System.in);System.out.print("Type your name: ");// your code goes hereSystem.out.println("Your name is: " + name);

the lines of code that will produce the result describedwhile (true){System.out.print("Type your name: ");String name = console.nextLine();int space = name.indexOf(" ");...
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question