logo CodeStepByStep logo

ProcessName

Language/Type: Java input Scanner
Related Links:

Add to the code below so that it reads the user's first and last name (an entire line as a single string), then prints the last name followed by a comma and the first initial. (You may assume that the user types valid input consisting of a first name, a single space, then a last name.) For example:

Type your name: Jessica Miller
Your name is: Miller, J.
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.