posted 11 years ago
Hi
I have managed to get a calculator program written although it is not working properly at the moment. For this purpose I have written my own stack and array classes.
I have made a file with only one equation in it:
49+62*61-36
and the program output should be - the second line should be in RPN format:
49+62*61-36
[49+62*61-36]
3795
But I am currently getting:
49+62*61-36
[36]
36.0
I don't see why it is only keeping the last token? all code is shown below. Any help will be much appreciated.
My arraylist class
my stack class
the class where the calculations happen.