Question: Please use Java You can assume that the String will be valid. The unformatted string is always in the following format: Hello, my name is

Please use JavaPlease use Java You can assume that the String will be valid.

You can assume that the String will be valid. The unformatted string is always in the following format: Hello, my name is NAME. I need to report EVENT. Please come to WHERE. - NAME: This part is the caller's name. - EVENT: This part describes the event called in. It may be one word (e.g. "theft"), or more than one word (e.g. "heart attack", "a very serious collision"). You should handle both lowercase and uppercase letters in the event. street (with possible spaces in between for the street name). An example of this is "127 East Main Street". As mentioned above, your method should take the unformatted string and format it in a specific way like described below. The all-capitalized parts are the parts you need to move around to match the following format: EVENT at WHERE reported by NAME Note: Please follow the format and do not include excessive elements or spaces. Examples System.out.println(emergency("Hello, my name is John Smith. I need to report a fire. Please come to 100 Circle Road.")); // expecting "a fire at 100 Circle Road reported by John Smith" System.out.println(emergency("Hello, my name is Mary Smith. I need to report a car accident. Please come to 2635 Main Street.")); // expecting "a car accident at 2635 Main Street reported by Mary Smith" System.out.println(emergency("Hello, my name is Joe Bell. I need to report a robbery. Please come to 3595 Oakwood Avenue.")); // expecting "a robbery at 3595 Oakwood Avenue reported by Joe M Bell

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!