Search:

Type: Posts; User: Norm

Page 1 of 4 1 2 3 4

Search: Search took 0.12 seconds.

  1. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Find a good book on beginning programming.
  2. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    I agree. I think this assignment is past your current knowledge.
    Try working on one with only one class and a couple of methods to see how to create objects and call their methods.

    Good luck
  3. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Then its value starts at -1 before there are any elements in the list.
    When there is only one element in the list, then the index to the last element is 0.

    Is that how your code uses the top...
  4. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    That's confusing. Is it a count of the number of items in the list
    or is it the index of the last element in the list.

    I'm not sure how to count the last element. Wouldn't that count always be...
  5. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    I don't think you answered my question.
    What value is in the top variable?
    Is it the index of the last element in the list or is it the count of the number of items in the list?

    Or is it the...
  6. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    What value is in the top variable?
    Is it the index of the last element in the list or is it the count of the number of items in the list?
  7. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Don't use the for each loop. You have a variable with the number of contacts in the list. Use a normal loop with the value of that variable controlling the number of loops.
  8. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Look at this simple program segment. If the array contains null, null is returned by the for each:


    String[] list = new String[3]; // create with 3 slots
    list[0] = "test"; ...
  9. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Please show the FULL output.
  10. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    try it an see what happens.
  11. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    You need to design what is to go on each line that you print out.
    Then you need to figure out where each piece of data on that line comes from.
    Then you can write the code to print out that line...
  12. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    You need to think about what data you want to print and where that data is located.
    What is in the list array?
    If you get an object from the list array, what does it contain? How do you get the...
  13. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    What class is the list variable?
    What does that class's to String method return?
    In the code you posted, you call the toString method seven times for each index's value.
  14. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Your program appears to be in a loop, repeatedly printing out the last entry in the list.
    Look at your logic to see why the code in the loop does not move the next item in the list or exit the loop....
  15. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    You have posted what looks like the definition for the AddressBook class.
    What is the "this" you refer to?
    Also where is the arraylist? I see an array but no arraylist.


    I have no idea what you...
  16. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Should it?
  17. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    where is it looking?
  18. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Use = to assign a value to a variable. An assignment returns the value (and type) of the left hand operand.
    Use == to compare two operands. It returns a boolean value.
  19. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    When you get errors you must post the full text of the error messages.

    This is interesting. If the list is full you don't allow it to be viewed:

    if(addressbook.isFull()){
    ...
  20. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    The problem is the code is indented but it's missing the {}s.
    ALWAYS code the starting { and the ending } down one line when coding an if statement. Start with this and THEN fill in the code inside...
  21. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    I'm living in Missouri, a state famous for its mules.
  22. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    I thought you had your design done and were now ready to code the program.
    Look back through the posts to see what you decided to do where and when. Then do that.

    Before you do any more coding...
  23. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    What variable is null? Make sure you give the variable a valid value before you use it.
  24. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Ok keep up the good work.
  25. Replies
    208
    Views
    11,987

    Re: Address Book Program Issues

    Ok. Have you answered the question you asked in post#145
    What happens when the user enters the other options:
    D
    U
    V
    S
Results 1 to 25 of 98
Page 1 of 4 1 2 3 4