Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
The question youve presented is a programming exercise requiring you to write a Java program that re...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started