Question: In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input

In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name

In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input name must be in the exact format as shown below (Firstname Initial Lastname). If it is not, your code need not work correctly. We will not enter invalid input like having 2 spaces instead of 1 or leaving or give two initials (even though many people have two or more middle names), or have other enhancements like Jr, II, 3rd, Firstname Initial Lastname Rearrange the input name into this format Lastname, Firstname I. Your dialog must look exactly like this when the user enters Mary J Blige. Enter a name in the form of 'First I Last': Mary J Blige Blige, Mary J. eu.jav Hints (use these hints, ignore them, use something else): Assume all inputs are in the correct format: FirstName, space, a one letter initial (no period), a space, and finally the last name Use Scanner's nextLine() method to return the entire line including spaces M M M M A "ABCD".indexOf("BC") returns 1 "ABCDEFG".substring(2, 5) returns "CDE" "ABC" + "DE" evaluates to "ABCDE" In the Java file NameRearranged.java, write a Java program that reads in a full name and rearranges that name as shown below. The input name must be in the exact format as shown below (Firstname Initial Lastname). If it is not, your code need not work correctly. We will not enter invalid input like having 2 spaces instead of 1 or leaving or give two initials (even though many people have two or more middle names), or have other enhancements like Jr, II, 3rd, Firstname Initial Lastname Rearrange the input name into this format Lastname, Firstname I. Your dialog must look exactly like this when the user enters Mary J Blige. Enter a name in the form of 'First I Last': Mary J Blige Blige, Mary J. eu.jav Hints (use these hints, ignore them, use something else): Assume all inputs are in the correct format: FirstName, space, a one letter initial (no period), a space, and finally the last name Use Scanner's nextLine() method to return the entire line including spaces M M M M A "ABCD".indexOf("BC") returns 1 "ABCDEFG".substring(2, 5) returns "CDE" "ABC" + "DE" evaluates to "ABCDE"

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

The question youve presented is a programming exercise requiring you to write a Java program that re... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!