JAVA Write a class to manipulate a string made up of a perso

JAVA:

Write a class to manipulate a string made up of a person\'s first name, middle initial, and last name. The entire name has to be created as one field and not three separate fields. The entire name must also been created as a mixture of uppercase and lowercase letters which simply is not proper. Your goal is to output the three components of the name as separate fields with proper uppercase and lowercase letters.

Solution

import java.util.Scanner; public class namessplit{ public static void main(String args[]){ String fullName=\"\"; String[] str; String firstName=\"\"; String lastName=\"\"; Scanner scanner=new Scanner(System.in); System.out.println(\"Enter the full name:\"); fullName=scanner.nextLine(); System.out.println(\"The names after split is:\"); str = fullName.split(\"\' \"); System.out.println(firstName+\"\' \"+lastName); } }
JAVA: Write a class to manipulate a string made up of a person\'s first name, middle initial, and last name. The entire name has to be created as one field and

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site