Loading...

Messages

Proposals

Stuck in your homework and missing deadline? Get urgent help in $10/Page with 24 hours deadline

Get Urgent Writing Help In Your Essays, Assignments, Homeworks, Dissertation, Thesis Or Coursework & Achieve A+ Grades.

Privacy Guaranteed - 100% Plagiarism Free Writing - Free Turnitin Report - Professional And Experienced Writers - 24/7 Online Support

Longitude and latitude dot to dot assignment answers

23/10/2021 Client: muhammad11 Deadline: 2 Day

Basic Java Assignment

Working with Strings and conditionals Spring 2021

TASK

You are working for a company that provides map services (much like Google Maps). Your company’s services are not

directly web-accessible; rather, other web sites call for maps, and embed the results in their content (and pay for the

privilege of doing so).

You are working in the consulting area of the company, and your current client is FIU. The university is asking for a

custom mapping application.

Your first task is to parse out the different parts of URL for requests. In other words, you will be writing code to pull data

items from the input URL string, and store them as separate data elements. URLs look like this:

 Protocol:

o This is the method used to transfer information across the internet. Valid values for protocol include the

following: http, https, ftp, and mailto, but could be any word of any length (excluding the special

punctuation characters).

 Domain information:

o Subdomain:

 This identifies a portion of content or logic available at this URL. For example,

“fiu.instructure.com” identifies FIU’s Canvas content among all other universities’ Canvas

courses on the instructure.com site.

o Domain:

 This is the string you purchase from a domain name registry to identify your server on the web.

o Top-level domain (TLD):

 Each top-level domain is controlled by a domain name registry. Familiar TLDs include .com, .edu,

and .gov; however, almost any text string can now be used as a TLD, e.g., .valentine, .horsehair,

or .frostbite. A domain name plus a TLD serves as a unique identifier for locating your server on

the internet, so that the world can find your content or application.

o Punctuation hint:

 The dot ‘.’ character separates the subdomain from the domain name, and the domain name

from the TLD.

 The domain parts can be of any length and contain any characters except the dot ‘.’ and the

forward slash ‘/’.

 Query parameters

o First parameter: univ

 This identifies the university using a university code. Examples: “FIU”, “UF”, “NDSU”.

 The name “univ” for the parameter is fixed but can be in any case.

 This parameter is always going to be the first parameter in the URL string.

o Second parameter: map

 Latitude and Longitude: these are the data values that serve as input to the map query, and

describe the geographic point the requestor would like mapped. Latitude is the first value, and

longitude is the second value.

 The name “map” for the parameter is fixed but can be in any case.

 This parameter is always going to be the second parameter in the URL string.

The special punctuation characters have special function, here are the hints that will help you locate the different parts

of the URL string:

 The string “://” separates the protocol from the rest of the URL

 The question mark ‘?’ character separates the domain information from the query parameters.

 The ‘=’ character separates the parameter name from the parameter value for both parameters.

 The ‘&’ character separates the first parameter from the second parameter.

 The pipe ‘|’ character separates the latitude and longitude values for the map parameter.

The university would like the mapping application to react differently for map points within the boundary formed by FIU

and Tamiami Park. Thus, your second task involves checking whether the map point defined by the latitude and

longitude values in the URL lies within a box formed by SW 8 th

Street on the north, 107 th

Avenue on the east, Coral Way

on the south, and 117 th

Avenue on the west. The latitude and longitude values corresponding to these roadways are

shown on the map below:

The North, South, West, and East edge boundary values for latitude and longitude should be defined as class-level

constants in the code.

Your third task involves creating a specific output for the case when the user requests FIU as the university and at the

same time the map point falls within the defined rectangle:

 Print “FIU location requested” if the univ parameter in the URL contains the value “FIU” (in any case) AND the

latitude and longitude point lies within the box defined above.

longitude

latitude

 In all other cases, print “Conditions not met”

Your final code should do the following:

 As input, prompt the user to enter a URL.

 As output, print each data element you have parsed from the URL, following instructions below, and using the

sample output as an example.

 Print “FIU location requested” or “Conditions not met”, based on the content of the URL values in the input

string.

As you work through the instructions below, refer to slides in 3c_stringVariablesAndValues.pdf and

3d_stringMethods.pdf from today’s class material for help with character indexing and the specifics on how String

variables and String methods work.

The following table provides descriptions of a set of methods you may find useful in this assignment:

Class Method Return Type

Description

String indexOf(int ch) int Returns the index within this string of the first occurrence of the specified character ch.

String indexOf(int ch, int fromIndex) int Returns the index within this string of the first occurrence of the specified character ch, starting the search at the specified fromindex.

String indexOf(String str) int Returns the index within this string of the first occurrence of the specified substring str. The returned index represents the start of the occurrence of the substring.

String indexOf(String str, int fromIndex) int Returns the index within this string of the first occurrence of the specified substring str, starting at the specified fromindex.

String lastIndexOf(int ch) int Returns the index within this string of the last occurrence of the specified character ch.

String lastIndexOf(int ch, int fromIndex) int Returns the index within this string of the last occurrence of the specified character ch, searching backward starting at the specified fromindex.

String lastIndexOf(String str) int Returns the index within this string of the last occurrence of the specified substring str. The returned index represents the start of the occurrence of the substring.

String lastIndexOf(String str, int fromIndex) int Returns the index within this string of the last occurrence of the specified substring str, searching backward starting at the specified fromindex.

String substring(int beginIndex) String Returns a new string that is a substring of this string. The substring starts at beginindex, and continues to the end of this string.

String substring(int beginIndex, int endIndex) String Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.

Double parseDouble(String s) double Returns a new double initialized to the value represented by the specified String s.

Instructions:

1. Create a new NetBeans project called yourname_assignment2

2. Define class-level constants for the four values that specify the map’s boundary edges.

3. Prompt the user to enter a URL string.

4. Read the input from the keyboard, and store it in a String variable.

5. For each of the nine parts of the URL, pull the data element of interest out of the URL.

o Use the methods in the table on the previous page to do the following:

 Use the punctuation in the URL to locate each data element

 Store each data element to an appropriately-typed variable

o Include only the text portions for each data element, do not include the URL punctuation.

o HINT: for some of the elements, you will not be able to get to the data with a single method call to one

of the methods in the table. Instead, you will need to invoke a combination of these methods to parse

the needed information from the input string. If you cannot identify a single method that does what you

need, then start considering combinations of methods to reach the desired data.

o HINT: there are many possible ways to encode this logic. Your approach may not be the same as other

classmates’ approaches. As long as your logic meets the requirements in this specification, it’s a good

approach.

o HINT: you may not need all of the methods listed in the table, but all are potentially useful.

Checkpoints:

As you work through the URL string, there are many points where intermediary variables should be

checked for a correct value. Print out helpful information for debugging to the screen. For example,

print the position of found punctuation character and check that it is what you expect. Then leave the

printing line in the source code and comment it out.

6. Once you have all the data parts in the their respective variables, print them out to the screen, as seen in this

example:

7. Convert the latitude and longitude values to double-typed variables (see the Double.parseDouble

(String s) method in the table) and store them in double variables.

8. Determine whether the requested map point lies within the FIU’s boundary rectangle. You will need to make

decisions for both the latitude and longitude components and only if both components are within their limits,

the point is in the rectangle. Make sure the limits are class-level constants.

o HINT: Instead of creating a one long and complex Boolean expression, break it down into smaller

expressions and save their results in Boolean variables. Then use those variables in the final expression

that determines whether the longitude and latitude components satisfy the limits concurrently.

9. Determine whether the value of the University parameter is “FIU” (in any case).

10. Print out the “FIU location requested” string if both university parameter and the map request

parameter satisfy the conditions. Otherwise, print “Conditions not met”.

11. Check that your final printout matches the sample output. Test multiple URL strings. Be sure to match your

output to the sample, including wording, spelling, spacing, and punctuation.

Grading points:

 Use of class-level named constants

 Use of variables with meaningful names and correct types

 Input of data with user prompts

 Correctness of math calculations

 Correctness of Boolean logic (ifs)

 Conformance of output to sample output

 Code organization (input/processing/output)

 Code alignment (indentation)

SAMPLE INPUT

The following sample input is provided to give you a few test cases. Please keep in mind that your code will be tested

with input beyond these strings.

http://fiu.instructure.com/?univ=FIU&map=25.757195|-80.375829

https://www.example.gov/?UNIV=Fiu&MAP=24.664648|-82.885596

ftp://www.maprequest.pictureframe/?univ=fiu&map=25.656248|-80.376633

ftp://www.maprequest.pictureframe/?univ=FSU&map=25.757195|-80.375829

WWW://SERVICE.DOMAINNAME.TOPLEVEL/?UNIV=fiu&MAP=25.747|-80.369

HINT:

o Instead of repeatedly entering these strings as user input when developing the code, declare a string variable,

set its value in the source code to one of the examples, and use this variable for as the URL string. After your

code is tested and works on all test strings, revert back to asking the user to enter the URL.

SAMPLE OUTPUT

Homework is Completed By:

Writer Writer Name Amount Client Comments & Rating
Instant Homework Helper

ONLINE

Instant Homework Helper

$36

She helped me in last minute in a very reasonable price. She is a lifesaver, I got A+ grade in my homework, I will surely hire her again for my next assignments, Thumbs Up!

Order & Get This Solution Within 3 Hours in $25/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 3 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 6 Hours in $20/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 6 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

Order & Get This Solution Within 12 Hours in $15/Page

Custom Original Solution And Get A+ Grades

  • 100% Plagiarism Free
  • Proper APA/MLA/Harvard Referencing
  • Delivery in 12 Hours After Placing Order
  • Free Turnitin Report
  • Unlimited Revisions
  • Privacy Guaranteed

6 writers have sent their proposals to do this homework:

Top Academic Guru
Instant Homework Helper
Financial Solutions Provider
Premium Solutions
Academic Mentor
Top Writing Guru
Writer Writer Name Offer Chat
Top Academic Guru

ONLINE

Top Academic Guru

Being a Ph.D. in the Business field, I have been doing academic writing for the past 7 years and have a good command over writing research papers, essay, dissertations and all kinds of academic writing and proofreading.

$39 Chat With Writer
Instant Homework Helper

ONLINE

Instant Homework Helper

I have read your project details and I can provide you QUALITY WORK within your given timeline and budget.

$50 Chat With Writer
Financial Solutions Provider

ONLINE

Financial Solutions Provider

I have assisted scholars, business persons, startups, entrepreneurs, marketers, managers etc in their, pitches, presentations, market research, business plans etc.

$22 Chat With Writer
Premium Solutions

ONLINE

Premium Solutions

I have worked on wide variety of research papers including; Analytical research paper, Argumentative research paper, Interpretative research, experimental research etc.

$20 Chat With Writer
Academic Mentor

ONLINE

Academic Mentor

I will be delighted to work on your project. As an experienced writer, I can provide you top quality, well researched, concise and error-free work within your provided deadline at very reasonable prices.

$17 Chat With Writer
Top Writing Guru

ONLINE

Top Writing Guru

I reckon that I can perfectly carry this project for you! I am a research writer and have been writing academic papers, business reports, plans, literature review, reports and others for the past 1 decade.

$22 Chat With Writer

Let our expert academic writers to help you in achieving a+ grades in your homework, assignment, quiz or exam.

Similar Homework Questions

Top 5 bicep exercises for the peak - Tell tale heart pdf - Hacking 101 book pdf - Penetration Testing Report - Advanced higher modern studies - Introduction - Looking at philosophy donald palmer pdf - Unimelb medicine guaranteed entry - Shadow health focused exam cough - Army operations order example - Tronair hydraulic mule manual - Give me liberty chapter 15 review questions - Acs code of ethics - Application for permission to continue study - Principle quantum number for the outermost 2 electrons in sr - Hip hop abs torrentz2 eu - Dataflux data management studio download - Acara achievement standards english - Tippi sweater with tortoise critter - Learning intentions and success criteria examples - The forsaken merman by matthew arnold summary - There's a sea in my bedroom worksheets - Memories of canning town - Bpp vle online library - Python knn data - Experience indicates that strategic alliances - High-low or least squares regression analysis should only be done if - The outsiders book cover project - Dalton sherman speech - Comprehensive problem 2 accounting - Class d amplifier noise - Catholic church aboriginal reconciliation - Critical thinking by moore and parker 12th edition - Michael himes three key questions - A coffee manufacturer is interested in whether - Defusement - 3675 yorkshire road pasadena ca - What does a mackerel sky predict - Philosophy unit 3 assignment - Tacpac set 1 music - Dante arthurs robert thompson - Creativity the work and lives of 91 eminent people - Making the right choices - Free fingerprint verification sdk - World of rolling stones bootlegs - Invictus movie summary and analysis - Masterwatt srl electric heaters - How to make a cross section in google earth - Positive 100 work response with three ref. due today at 10:00pm - Question of sport picture round - 250 word essay - Who is elya yelnats in the book holes - Advocating for social justice discussion - Semhs school loop - Flysky fs gt3c reverse throttle - When does brutus join the conspiracy - Cultural genogram symbols - Book of revelation chapter 12 - I need 2 replies , 200 words each on Society for Human Resource Management (SHRM) - Marketing essay 500 words 10 hrs - List of printmaking artists - How the earth was made hawaii worksheet answers - Bino the elephant theme song - 4/24 weatherly close nelson bay - The trial of tempel anneke notes - Gerber baby food international marketing - HR_GLOB_FIN (U5) - Tony stark case study answers - Management and organization - 2pac ghetto gospel meaning - Fin 100 week 5 homework - Green anaconda scientific name - Cannon-bard theory of emotion - Hr - Andalusian stallions at stud - Wyatt vs stickney - College Algebra - QNT561 Week 1 Statistics Concepts and Descriptive Measures - Duferco steel saldanha jobs - Fundamental methods of mathematical economics mcgraw hill - Premiers reading challenge hall of fame - Karlarra house aged care - Was george justified in killing lennie why or why not - Soccer coach responsibilities resume - I 130 cover letter - Managing quality integrating the supply chain 4th edition pdf - Fortigate transparent mode limitations - 4 glade court greenwith - Chemical Kinetics - The untimely death of professor hathaway - HCS 214 Wk 3 - Respiratory System—Analyzing a Progress Note - HS 2200 Social Welfare - Animal cell poster ideas - Special relativity lecture 3 - Jeff nippard fundamentals hypertrophy program - The wounded knee massacre answer key - Qualitative analysis of group 3 cations flow chart - Whipps cross eye clinic - Sam sneads early bird menu - Brannigan foods strategic marketing planning