Search:

Type: Posts; User: Loraeron

Search: Search took 0.08 seconds.

  1. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    no it's still wrong, during the first pass it should find all the delimiters in the code that i'm looking for then compare them with the delimiters in the stack. It is only finding one of them...
  2. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    ok, so i added it into the catch block, and found the error. it was just an error where i had placed code to display what was being stored in strLine for debugging, don't need that anymore as i...
  3. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    the pass number is just a variable i called x that i incremented after each time through the while and printed so i knew how many times it is reading the text file and what is being seen with each...
  4. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    ok, here is it broken down a little better, i added another println stating the pass it was in during each loop of the while along with the pass number:



    run:
    Enter a file to be read: (EX:...
  5. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    Ok, i did the println() portion and it looks like it is reading in the entire text file.
  6. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    haha, i read it and did some text, using it with a variable that i tried to increment after each readLine call.

    int x = 0;

    after the readLine did x++;

    and then it went into:
    ...
  7. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    so what would you attach charAt() too? Would you simple say if(strLine.charAt() = "{") then do this.....?
  8. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    how would you implement charAt()? because i don't know exactly where the braces, brackets, etc will be?
  9. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    ok, so would i need to convert each line during the while loop into an array of characters before passing them into the if statements checking for proper types?
  10. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    I thought using the readLine() method would automatically read the entire line until it found no more words/characters then move to the next line?
  11. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    That would be the issue I am having, I can't make it find brackets, braces, etc on a line that has characters already on it.
  12. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    I'll look into it, either way i'm still at a loss for why it's not finding all the parameters i'm looking for in the first pass. I don't think the second pass is effecting this at all.
  13. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    I wrote it for two haha, didn't know a way to make it read twice without opening the file and closing then reopening and closing.
  14. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    New code after adding print statements after every push or pop with the stack



    /*
    * A Java program can have the following type of delimiters: {, }, (, ), [,
    * and ]. In a correct Java...
  15. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    how do you actually do the tag trick, i've never done that before. I will go through and add println()
  16. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    Updated code is below, it seems it is holding a value in the stack which is good, we are getting a error null for some reason, but the code still runs, only other problem is it is only holding one of...
  17. Replies
    35
    Views
    3,496

    Re: Using Stacks Homework Help

    After adding a print statement right below the code


    while((strLine = br.readLine()) != null)
    {

    during the first read file cycle it prints out:


    run:
  18. Replies
    35
    Views
    3,496

    Using Stacks Homework Help

    I will go ahead and apologize for the massive code slice, but I am stuck on a problem. The code compiles and runs, but is not acting properly. I have tried to comment as best I can throughout the...
Results 1 to 18 of 18