Java: Programming - Flip Name
Name ______________________
Write a method, flipName, which has a string parameter
which contains a name in last, first format. It should return
the name in first last format as a string, or "ERROR" if the argument
was not correctly formed.
For example, the following main program.
public static void main(String[] args) {
System.out.println(flipName("Maus, Michael"));
System.out.println(flipName("Einstein, Albert"));
System.out.println(flipName("Prince Albert"));
System.out.println(flipName(null));
}
The output would be.
Michael Maus Albert Einstein ERROR ERROR
Method only. You only have to write the method, not an entire program.
Error processing If the parameter is null, or if there is no ", ", return the string "ERROR".















