Question: In Java Please: k * * stringReformat takes a person's name in the format and t reformats it to the form Preconditions: the string is

In Java Please:

In Java Please: k * * stringReformat takes a person's name in

k * * stringReformat takes a person's name in the format and t reformats it to the form Preconditions: the string is not empty there is exactly one',(comma) and it comes at the end of the Last name there is 1 space after the comma there is exactly one space between the First name and the Initial The Initial is a single character followed by a '." * Here are some examples (using"informally): k

 k Alex P Keaton"  public static String stringReformat( String name) String theAnswer"this is not the answer" // example code starts here: delete or comment out when you have completed the function String subExamplename.substring(1,5); // some example code char theChar-name . charAt (4); Stdout.println(" stringReformat demol. the substring (1,5) is: ubExample); if ( theChar = ', ' ) Stdout.println(" stringReformat demo2. the character in position 4 is a comma") else Stdout.println(" stringReformat demo2. the character in position 4 is NOT a comma, it is: "+ theChar); // end of example code return theAnswer / TODO 3: fix this

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!