Answered step by step
Verified Expert Solution
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
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. Create a file that has the data for at least five points. You can use notepad to make your file. Each line in the file should have each points lat and lon coordinates and a description. It could look like this: Las Cruces Raton Tucumcari Gallup Albuquerque 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. 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 GeoPointlat lon, description pointList.appendnewPoint Inside the Do another yn 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 yn and loop if they respond with y
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.
Create a file that has the data for at least five points. You can use notepad to make your file.
Each line in the file should have each points lat and lon coordinates and a description. It could look like this:
Las Cruces
Raton
Tucumcari
Gallup
Albuquerque
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.
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 GeoPointlat lon, description
pointList.appendnewPoint
Inside the Do another yn 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 yn and loop if they respond with y
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started