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.


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

Results 1 to 4 of 4

Thread: Does anyone have answer of this Assignment??

  1. #1
    Junior Member
    Join Date
    Jan 2011
    Thanked 0 Times in 0 Posts

    Default Does anyone have answer of this Assignment??

    Write a program SortCities, reading any number of cities with their corresponding postal numbers from a text file. You may assume that each line in the file contains one postal number (integer) and one city (string) and that they are separated by a semicolon ( ; ). Create a class City, representing a city. The class City should implement the interface Comparable.
    After all cities of the file have been read, they should be printed in sorted order by postal number. An example of an execution:

    Reading cities from file: C:\Temp\orter.dat
    Number of cities found: 7
    23642 Höllviken
    35243 Växjö
    51000 Jönköping
    72211 Västerås
    75242 Uppsala
    90325 Umeå
    96133 Boden

    Thank u

  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Washington, DC
    My Mood
    Thanked 636 Times in 540 Posts

    Default Re: Does anyone have answer of this Assignment??

    That's not how this works. We are not a code service. If you have a specific question, post an SSCCE (that's a link) that demonstrates what you've tried, where you got stuck, etc. See my signature to learn how to ask smart questions.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    United Kingdom
    My Mood
    Thanked 293 Times in 226 Posts
    Blog Entries

    Default Re: Does anyone have answer of this Assignment??

    Like Kevin says, please show us you have made an effort and we will be more than happy to help.

    Don't forget to check out our Code Snippets forum - Java Code Snippets and Tutorials - Java Programming Forums

    There are lot's of code examples there that will help.

    Tip - http://www.javaprogrammingforums.com...ner-class.html
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

  4. #4
    Member DanBrown's Avatar
    Join Date
    Jan 2011
    My Mood
    Thanked 12 Times in 12 Posts

    Default Re: Does anyone have answer of this Assignment??

    I love the way you reply Javapf
    Thanks and Regards
    Dan Brown

    Common Java Mistakes

Similar Threads

  1. [SOLVED] Begginer Question please help ASAP! (Easy to Answer)
    By Bagzli in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 11th, 2010, 10:00 PM
  2. Replies: 5
    Last Post: August 5th, 2010, 09:16 PM
  3. [SOLVED] Problem with a tutorial program(Adding the answer of two squared numbers together)
    By Melawe in forum What's Wrong With My Code?
    Replies: 20
    Last Post: April 7th, 2010, 09:03 AM
  4. Replies: 1
    Last Post: February 22nd, 2010, 08:20 AM
  5. Arrays.equals not returning correct answer.
    By Anyone in forum Collections and Generics
    Replies: 2
    Last Post: February 11th, 2010, 10:12 AM