Question: Part 0 3 : Get Acronym Method Description getAcronym ( String ) : String A public static method that when called and passed a `

Part 03: Get Acronym
Method Description
getAcronym(String) : String 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.
doGetAcronym(Scanner) Partially provided in template and called by the menu, which provides a Scanner object. 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
Here are some examples showing what the value returned by your `getAcronym` method should be for different argument values:
Example 1
Enter some words : fear of missing out
Acronym for fear of missing out : FOMO
Example 2
Enter some words : self contained underwater breathing apparatus
Acronym for self contained underwater breathing apparatus : SCUBA

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!