Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Getting Distance between two addresses

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Getting Distance between two addresses

    I need help , i am doing a school assignment which involves creating an application which a user can input two addresses and output the driving distance between them.

    I don't have a clue whether it can be done or where to start

    Can you please give me an idea on where to start

    Thanks in advance


  2. #2
    Member
    Join Date
    May 2011
    Location
    west palm beach, FL
    Posts
    189
    My Mood
    Tired
    Thanks
    41
    Thanked 11 Times in 10 Posts

    Default Re: Getting Distance between two addresses

    check out Scanner (Java 2 Platform SE 5.0)

    or you could go on youtube and search for name "thenewboston" he has beginner java tutorials like 60 or so and explains nicely everything
    Last edited by derekxec; July 22nd, 2012 at 10:13 AM.

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Getting Distance between two addresses

    Quote Originally Posted by Shockwave786 View Post
    I don't have a clue whether it can be done
    Funny enough some problems can not be solved, but that is a different story.


    Quote Originally Posted by Shockwave786 View Post
    or where to start
    Can you please give me an idea on where to start
    Sure can:

    Quote Originally Posted by Shockwave786 View Post
    ...a user can input two addresses...
    You said it yourself mate. derekxec mentioned a class which will assist in doing just that.

  4. #4
    Member
    Join Date
    Jun 2012
    Location
    Left Coast, USA
    Posts
    451
    My Mood
    Mellow
    Thanks
    1
    Thanked 97 Times in 88 Posts

    Default Re: Getting Distance between two addresses

    Quote Originally Posted by Shockwave786 View Post
    ...whether it can be done...
    I think I would work on this part before getting too deep into implementation details.

    I mean, forget Java for a minute. Forget programming. Forget everything except the problem:

    If you wanted to give someone driving instructions to get from, say, 950 Mission Street in San Francisco, California, to, say, 1807 Telegraph Avenue in Oakland, California, how would you do it? If you can't figure out this part, then there's not much use in wasting a lot of time learning some programming language just for this task, right?

    Well since I don't live in San Francisco or Oakland, I don't know how to get from Point A to Point B, but I do know how to get driving instructions from Google or Bing or MapQuest or ...

    So, before trying to figure out how I would create the driving instructions, I might try one of those sites to see what they present.

    Wow! It's all there: How to get from Point A to Point B. Amazing!

    Now, here's the thing. It took hundreds of programmers (thousands, probably) many man-hours (thousands, hundreds of thousands, whatever) to create the applications and probably even more resources to create a data base that can be used to tell us how to get from Point A to Point B for just about anywhere on the planet.

    How the heck could anyone do that as a homework assignment? (That's a rhetorical question. I don't need to see your answer. The site's swear filter would probably redact most of your response anyhow.)

    Well, here's what I might do: I would see if there were any references on the web that talked about embedding driving instructions into a Java program.

    A couple of potentially useful hits:

    Getting Started with Bing Maps in Java

    Google Maps API

    Etc.


    Now, it still might be pretty hairy for a beginning Java programmer to implement a program using stuff like that, but maybe it gives you something to be thinking about as you work your way through Java tutorials or other reference material.


    Cheers!

    Z
    Last edited by Zaphod_b; July 23rd, 2012 at 10:55 AM.

Similar Threads

  1. i am having a problem with the distance formula,help needed!
    By Bentino in forum What's Wrong With My Code?
    Replies: 4
    Last Post: March 22nd, 2012, 07:07 PM
  2. Java client development for distance learning.
    By bosozoku in forum Java Theory & Questions
    Replies: 0
    Last Post: March 4th, 2012, 10:01 AM
  3. Distance between 2 points
    By captain in forum Java Theory & Questions
    Replies: 3
    Last Post: February 22nd, 2012, 12:53 AM
  4. Memoization (dyanamic programming) for edit distance recursion
    By rph12 in forum Algorithms & Recursion
    Replies: 4
    Last Post: January 28th, 2011, 10:37 AM
  5. Compress Ipv6 Addresses
    By abhay8nitt in forum Java Networking
    Replies: 5
    Last Post: May 20th, 2010, 06:58 AM