Question: Do not use StringBuilder and do not use split and do not use an array to split the string. Use indexOf and lastIndexOf in Java.

Do not use "StringBuilder" and do not use "split" and do not use an array to "split the string." Use "indexOf" and "lastIndexOf" in Java.
A public static method that when called and passed a String must compute and return
a string value that contains just the capitalized first letter of each word.
Note: the arguments to this method will always be a string containing one or more words,
and the words will always be separated by a single space character, and a space character will
always be followed by another word.
Hints:
The indexof method can be very helpful for finding things like space characters in a
String
Java has an overloaded indexof method with takes an extra int argument indicating
where to start a search in a string
Java also has an lastIndexof method, which searches a string starting at the end.
The substring method can be very helpful for extracting one or more characters from
a string
You may need to write some code to make decisions based on whether the input has
one (just first), two (first and last), or three (first, middle, and last) names.
A loop will definitely be useful.
It can be helpful to know and understand the difference between the scanner methods
next and nextLine
The Java String class include a method named toUpperCase that may also be
useful.
Partially provided in template and called by the menu, which provides a scannerobject.
Remove the placeholder message.
Then implement the following functionality:
Prompt the user to enter some words
Collect and store the user's input in a string variable
Call the getAcronym method, passing the user's input as an argument
Store the value returned by the getAcronym method in another string variable
Display the name and acronym as shown in the examples below
Do not use "StringBuilder" and do not use "split"

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 Programming Questions!