Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

3 . Similar to previous assignments but instead of only working with two points you are going to read in a list of five or

3. Similar to previous assignments but instead of only working with two points you are going to read in a list of five or more points from a file.
4. Create a file that has the data for at least five points. You can use notepad to make your file.
5. Each line in the file should have each points lat and lon coordinates and a description. It could look like this:
32.341906,-106.758862,Las Cruces
36.884615,-104.439862,Raton
35.171950,-103.724588,Tucumcari
35.528541,-108.758155,Gallup
35.105925,-106.628423,Albuquerque
6. In the main part of your program do the following:
a. Read the text file of coordinates with your python code
b. Create GeoPoints for each lat, lon set of coordinates
c. Create a list that you will use to organize the GeoPoints.
7. Example:
a. Read coordinates from the file.
b. As you read lat, lon and description from the file, use those values to create a GeoPoint object and add to a List. Something like:
newPoint = GeoPoint(lat, lon, description)
pointList.append(newPoint)
8. Inside the Do another (y/n)? loop do the following:
i. Ask the user for their location.
ii. Create a point to represent the users location.
iii. Iterate through the point list and find the closest point.
iv. Tell the user which point they are closest to in this format:
You are closest to which is located at
v. Ask Do another (y/n)? and loop if they respond with y

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago