Question: Write a program to demonstrate string manipulation. You will need to use a variety of string methods. Using Scanner method nextLine( ) ONLY ONCE

Write a program to demonstrate string manipulation. You will need to use a variety of string methods. Using Scanner method nextLine( ) ONLY ONCE Rule: THERE WILL BE NO USE OF next() ALLOWED - NEGATIVE 5 marks if it's used No flow chart required for this assignment. Input a name in the format Title, First name, Last name (i.e. Mr. John Smith, Ms. Annie Buddy). Output the name in the following formats in the following order: a) Original input (ie. Mr. John Smith) b) First name Last name (ie John Smith) c) Last name, First name (ie. Smith, John) d) Title Last name (ie. Mr. Smith) e) Last Name, Initial (ie. Smith, J.) The challenge here is to use as many built in methods within the string class to make this sequential code as streamlined as possible! Rule: You cannot reach ahead and use arrays and split command here - that is working around the emphasis on string manipulation.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
