Search:

Type: Posts; User: PeskyToaster

Search: Search took 0.09 seconds.

  1. [SOLVED] Re: Reading file and adding it to an array through a method

    I got the above to work but it prints it out all on one line which I can fix. I have a distance method to find the distance between to inputted zip codes



    public int distance (int zip1 , int...
  2. [SOLVED] Re: Reading file and adding it to an array through a method

    I see that it skips right to null but I need to have it there somewhere. I know that I was missing an i++ to keep it going along the while loop. What should I return at the end and where in the loop?...
  3. [SOLVED] Re: Reading file and adding it to an array through a method

    I now have


    public ArrayList search(String str) {

    ArrayList<ZipCode> searchList = new ArrayList<ZipCode>();
    int i = 0;
    while (i < list.size()) {
    ...
  4. [SOLVED] Re: Reading file and adding it to an array through a method

    This is a different method from the first question. I posted the new method I needed help on, on the first page. It seems it is not adding the found Zip Codes to the array list
  5. [SOLVED] Re: Reading file and adding it to an array through a method

    This code is supposed to search through the list of zip codes by city or state and add the ones that match to an arraylist then return that arraylist. So if I type in "new" it should return NEWARK...
  6. [SOLVED] Re: Reading file and adding it to an array through a method

    It only returns two empty brackets []. I am just assuming that it is correctly finding the values and something is wrong with adding it into the searchList
  7. [SOLVED] Re: Reading file and adding it to an array through a method

    When I commented out the null it worked correctly and found the right zip code. But I need to return null if the (int zip) that is inputted is not on the list of zip codes or isn't a valid response....
  8. [SOLVED] Re: Reading file and adding it to an array through a method

    What do I need to do to fix this? I thought the i++ would send it through the for loop until it reaches list.size().



    EDIT: By removing the null I can get it to search through the list and find...
  9. [SOLVED] Re: Reading file and adding it to an array through a method

    Why is it only comparing to the first one?
  10. [SOLVED] Re: Reading file and adding it to an array through a method

    I'm am testing out a method called



    public ZipCode findZip (int zip) {
    ZipCode p = new ZipCode(0);
    for(int i = 0; i < list.size(); i++) {
    if...
  11. [SOLVED] Reading file and adding it to an array through a method

    I am creating an Array List of zip codes (29000 of them) and I am having trouble getting it to add the complete zipcodes to the arrayList. I think my problem is actually using the ArrayList because...
Results 1 to 11 of 11