Find Jobs
Hire Freelancers

C# program to calculate zip code distance (radius) from a csv file

$10-30 USD

Completed
Posted over 10 years ago

$10-30 USD

Paid on delivery
I need help with my final. It is a c# program to calculate zip code distance from a csv file. The design was done for us and about half the program. We just have to fill in the rest. Here is how we were told we have to do it. Your task is to build a C# application that can search adjacent cities and zip codes within a given distance from a given zip code. Instructions • Use the attached template project that includes all the necessary files, controls, event handlers, and methods. You will just need to define the ZipCode class properly and fill out event handlers and methods of MainForm class according to the following instructions and comments inside the template project. • First, define a ZipCode class with the following properties. o Code – The five digit ZIP code o City – The city name of the ZIP code o State – Abbreviation for the state which the ZIP code is in. o Latitude – The latitude of the ZIP code o Longitude – The longitude of the ZIP code • Second, implement LoadData() method that reads data (zip code, city, state, latitude, and longitude in the order from the left-most column) from a file ([login to view URL]) (refer to Tutorial 8-4) and save the data to a List type instance variable (_zipCodes). To do so, use a loop to read the .csv file line-by-line and extract code, city, state, latitude, and longitude from each row. Then create a ZipCode object by using the extracted data and add the created ZipCode object to _zipCodes list variable. This method is used in the Form_Load event hander so that it can be executed when your application is loaded and other methods can use _zipCodes list. The following figure shows some sample data. • Third, implement FindZipCode (string code) method, which finds and returns a ZipCode object from the _zipCodes list using code parameter. There can be many ways to do the task but a simple loop will work. This method is to be used within the btnFind_Click(object sender, EventArgs e) method. • Fourth, use the following Distance(ZipCode code1, ZipCode code2) method that can calculates the distance between two zip codes using their latitude and longitude data. This method is also to be used within the btnFind_Click(object sender, EventArgs e) method. // calculate distance between two zip codes public static double Distance(ZipCode code1, ZipCode code2) { double d = [login to view URL]; if (code1 != null && code2 != null) { double r = 3956.087107103049; double latitude1Radians = ([login to view URL] / 180) * [login to view URL]; double longitude1Radians = ([login to view URL] / 180) * [login to view URL]; double latitude2Radians = ([login to view URL] / 180) * [login to view URL]; double longitude2Radians = ([login to view URL] / 180) * [login to view URL]; d = (r * 2) * [login to view URL]( [login to view URL]( [login to view URL]([login to view URL]((latitude1Radians - latitude2Radians) / 2), 2) + [login to view URL](latitude1Radians) * [login to view URL](latitude2Radians) * [login to view URL]([login to view URL]((longitude1Radians - longitude2Radians) / 2), 2) ) ); } return d; } • Finally, complete the btnFind_Click(object sender, EventArgs e) method by referring to comments inside the project template. Requirements and desired features • When zip code and distance are submitted to your application, a list of zip codes and cities within the given distance should be displayed using a ListView control. • The distance between zip codes should be calculated based on their latitudes and longitudes.
Project ID: 5217216

About the project

2 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
----- Bucsfan ----- Dear sir, I'm an expert in .NET with 10 years experience working with C#. I've read your requirement carefully. It's written clearly. I'll take my best effort to complete it pefectly within 0.5-2 days. Kind regards, LY
$30 USD in 2 days
0.0 (0 reviews)
0.0
0.0
2 freelancers are bidding on average $30 USD for this job
User Avatar
Hi, This should be easy to do. I can delivery the source code with all the comments in one day. And if you have the sample data of zipcodes please send me Regards,
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
##BUCSFAN Hello Sir. My name is Vinicius and although I'm from Brazil I'm a fluent English speaker. I can program the classes you need. Give me this chance and I'll get you a good piece of code. Thank you for your time and looking forward to work with you. --Vinicius Zolin
$30 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Charlotte, United States
5.0
1
Payment method verified
Member since Dec 11, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.