Patience, young grasshopper. Your earlier post is time stamped at 10:30 pm. I am willing to bet that many of our visitors and certainly the owners of this website are in bed. In addition, you have posted a lot of code and additional information, so it takes a little while for us to figure out what is going on.
With that said, let me see what I can do to help you out:
so technically OpStack is empty right?... will this affect the rest of
the evaluation of the expression?
Yes, this is totally correct. In fact, your analysis of what SHOULD happens looks fine to me. So now we need to find out what your program ACTUALLY DOES.
because i can get my application to evaluate
((2^((4+(7*1))/2))) and it returns 32
and when i do ((4^0)+6) it returns 7
but it wont calculate ((2^((4+(7*1))/2))/((4^0)+6))
this is the output:
Okay, this is a good place to start in tracking down the problem. To continue, you need to use some debugging techniques. A visual debugger will help a lot if you know how to use it. However, simply adding System.out.println() calls (abbreviated to SOP hereafter) in your code will help track down what is happening. To start,
you should print out simple messages like "in case '+'" so that you can trace the execution of the program. From there, you should print out values of the variables to ensure that they are what you expect.
Debugging is a learned skill. I am not willing to do it for you since I think it is essential that you learn how to do it on your own.
i need away to deal with exponents of negative and zero..
Why are you writing your own code to do exponents? I strongly suggest that you use the Math.pow() method which takes care of all of these details for you. Unfortunately, this method uses doubles rather than ints, so you will need to learn how to perform a type cast to convert the result back to an int. Look in your textbook for information about how to do this.
If you are not allowed to use the Math.pow() method for some reason, I strongly suggest that you create a separate method for this calculation. In fact, your code could be cleaned up a lot by separating things out into short methods that perform a single, well-defined class. It takes some experience and practice to be able to do this well, so I encourage you to try it as much as possible.
I hope these tips help you along the way. If you don't understand any of my suggestions, please post back and ask for clarifications. Also describe what you tried and I will be glad to continue to help you.
Keep Coding!
Layne