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 7 of 7

Thread: Array entry

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Array entry

    Hi i have a problem. this is the following task i am trying to do.

    Write an interface Directory to manipulate entries in a telephone directory for the University. The interface must support the following operations:
    1) The ability to insert new entries into the directory. Entries should be stored in alphabetical order of surname.
    2) Delete entries from the directory either by name or number
    3) Provide a lookup method that will find the extension no of a member of staff given
    his/her name. You should try to make this method run as efficiently as possible.
    4) Change a person’s telephone number
    5) Print the telephone directory in a neatly tabulated fashion.

    Write a class ArrayDirectory that implements this interface using an array to store the telephone directory information. The class must store the surname and initial for each member of staff and their telephone extension (a four digit number which may start with a zero). You may find it useful to define a class Entry to store information about individual
    entries. The entries should be read into the array from a text file consisting of multiple lines in the following format:

    Surname<tab>Initials<tab>Telephone extension

    The part that i am stuck on is trying to do the entry method, delete entries method, loop up method, change persons telephone number and be able to print it.

    anyone able to help me with this please?

    thanks


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

    Default Re: Array entry

    What trouble are you having with it? What have you tried? What specifically are you confused about?
    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
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Array entry

    I haven't tried anything yet. Its more i just don't know how to go about implementing my own entry and delete methods for an array. if that makes sense?

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Array entry

    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!

  5. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Array entry

    it was more asking for guidance tbh rather than a post like that..

  6. #6
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Array entry

    if you wrote some code post here, so we can build on that.. try to use arraylists for add, delete and sort it supports those operations.. here ArrayList (Java Platform SE 7 )

  7. #7
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,424
    My Mood
    Hungover
    Thanks
    144
    Thanked 636 Times in 540 Posts

    Default Re: Array entry

    Quote Originally Posted by greenie1234 View Post
    it was more asking for guidance tbh rather than a post like that..
    That post is guidance. If you're having trouble starting your assignment, the best thing you can do is break it down into smaller pieces. That post describes how to do that.

    More recommended reading: Starting Writing a Program
    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!

Similar Threads

  1. User entry needs to be exactly 5 digits
    By tyneframe in forum Java Theory & Questions
    Replies: 4
    Last Post: September 29th, 2012, 09:54 PM
  2. How to sort a Map.Entry in a for loop?
    By Porknbeans in forum Collections and Generics
    Replies: 1
    Last Post: March 23rd, 2012, 07:02 AM
  3. Table with CustomModel when clicked shows old entry
    By Nesh108 in forum AWT / Java Swing
    Replies: 6
    Last Post: November 9th, 2011, 06:38 AM
  4. need help w/ entry level homework...
    By rbread80 in forum What's Wrong With My Code?
    Replies: 6
    Last Post: October 3rd, 2010, 10:24 PM
  5. how to add a new entry in a current array
    By chronoz13 in forum Java Theory & Questions
    Replies: 1
    Last Post: December 28th, 2009, 06:39 PM

Tags for this Thread