Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    The normal way to find problems in code is to debug it. Add lots of printlns to show what the code is doing and examine what is printed out. If you understand what the code is supposed to do, the...
  2. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    At line 146 the code uses an index of 1 in an array with less than 2 elements.
    Its probably the following array:


    String[] lines = new String[1];

    Why is that array only given 1 element?
  3. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    Continue adding println statements that print out the values of the variables. For example print out the value of the variable: token in the infixToRPN() method. Print it out when it is first...
  4. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    Looks like you need to do some debugging to see why the code is not doing what you want.
    One way to debug code is to add lots of println statements that print out the values of variables that...
  5. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    What's in the input file you are reading for testing the code?

    Where does this part of the program's output come from: "equation read in"?
    I don't see that String in the program. How can the...
  6. Replies
    11
    Views
    1,956

    Re: Java Calculator problems

    Can you post what the program is outputting and also post what the output should be and explain what is wrong with the output?
Results 1 to 6 of 6