assignment help,

This is the place for queries that don't fit in any of the other categories.

assignment help,

Postby beilman419798 » Wed Dec 04, 2013 5:18 pm

This assignment will take a file (text) containing the latitudes of airports in Kansas and convert them to degrees. The converted data will be output to an external text file. You will then us another text file which contains the (x,y) coordinates of 12 airports in Kansas and determine the nearest neighbor to each airport. This data will be used to plot a graph of all airports and their relative locations.

Function 1:

Write a function FileDMS2FileDD(dmsFile, ddFile), which reads the latitudes in
text file dmsFile, converts them into decimal degrees, and saves the decimal degrees to the text file ddFile. The text file dmsFile has four columns that are separated by space. The first column is the names of the points and the other 3 columns are the latitudes in degrees, minutes and seconds respectively. The output text file ddFile should have two columns. The first column is the names of the points and the second column is the decimal degrees of the points. You can use the latitudes of twelve Kansas airports in the file KansasAirportLatitudesInDMS.txt to test your function.

Function 2:

Write a function NearestNeighbor(pointsFile, nnpointsFile), which finds the nearest
neighbors for the points in the text file pointsFile and writes the nearest neighbor
information to the text file nnpointsFile. The text file pointsFile has three columns that are separated by comma. The first column is the unique IDs of the points and the other two columns are the x and y coordinates of the points respectively. The output text file
nnpointsFile also has three columns and separated by comma. The first column stores the IDs of the points. The second column stores the IDs of their nearest neighbors and the third column stores the distance to their nearest neighbors. You can use the points in file
Points.txt to test your function.

Function 3:

Using the data file created in the previous function create a plot of the positions of each airport (see example plot).



LBL 37 2 39.153
DDC 37 45 47.225
GCK 37 55 39.065
GBD 38 20 39.905
ICT 37 38 59.869
AAO 37 44 51.196
EWK 38 3 25.593
GLD 39 22 14.225
HYS 38 50 41.771
SLN 38 47 29.335
FOE 38 57 3.436
MHK 39 8 27.502



any help would be greatly appreciated.
thanks roger
Last edited by Yoriz on Wed Dec 04, 2013 5:39 pm, edited 1 time in total.
Reason: First post lock
Posts: 2
Joined: Wed Dec 04, 2013 5:08 pm

Re: assignment help,

Postby Yoriz » Wed Dec 04, 2013 5:41 pm

Hi welcome to the forum, please read the 'new users read this' link in my signature.
Which part of your code are you having problems with?
Due to the reasons discussed here we will be moving to on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 1672
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Re: assignment help,

Postby stranac » Wed Dec 04, 2013 5:44 pm

You use the def keyword to create a function.

If you want more help than that, show us what you have tried.
Friendship is magic!

R.I.P. Tracy M. You will be missed.
User avatar
Posts: 1790
Joined: Thu Feb 07, 2013 3:42 pm

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 14 guests