Question: Help with strings and class string #typ value; #det value; #loc value; #lat value; #lng value; 1) Make a scanner class to input a message

Help with strings and class string

#typ value; #det value; #loc value; #lat value; #lng value;

1) Make a scanner class to input a message and store into a String variable (message)

2) Parse the message into 5 different types of info specifyed by #(type, location, detail, latitude, and longitude and store these values into their own variables

3) Divide message into the seperate substrings and store in 2 variables(first & last) that hold where the substring first starts and finishes (last)

4) Then when the numbers are assigned to the first and last, discard the # tag(ie. #typ or #loc) and extract where the value starts and finishes

5) Then take the substring at those staring and ending positions to assign it to the variables mentioned in (2)

6) Then trim leading and trailing whitespaces from the strings

7) Then we repeat the steps for each substring

8) Then change the type value into upper case and make the "," in detail and location into "-"

Then print statements showing each variable with the information

Type: VALUE

Detail: value

Location: value

Latitude: value

Longitude: value

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!