Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

What is a joint venture?

Answered: 1 week ago