1 Replies - 267 Views - Last Post: 06 April 2013 - 10:08 PM Rate Topic: -----

#1 Sirr_Purr_the_Cat  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 33
  • Joined: 14-June 12

Postfix Evaluator Giving Really Weird Numbers from Stack

Posted 06 April 2013 - 08:11 PM

I was given the assignment to create a postfix converter and then evaluator using a stack class we created in class.

My problem is this, I believe that my algorithm is correct but for some reason, the numbers that are being outputted are WAY off base and don't make much sense. If I run the calculator, input a 0, then press "=" (solve button) it will output a 48. 2 will output a 50. 3 a 51 and so on. No idea why so I am asking for some help. I imagine it has to do with the way I'm implementing my stack class but I thought it was great.

Heres my code on pastebin. The Stack class first, Postfix converter, Postfix evaluator, and finally the Calculator GUI that puts it all together.

http://pastebin.com/NhXuYNh9

Any and all help is greatly appreciated.

Is This A Good Question/Topic? 0
  • +

Replies To: Postfix Evaluator Giving Really Weird Numbers from Stack

#2 macosxnerd101  Icon User is online

  • Self-Trained Economist
  • member icon




Reputation: 10397
  • View blog
  • Posts: 38,473
  • Joined: 27-December 08

Re: Postfix Evaluator Giving Really Weird Numbers from Stack

Posted 06 April 2013 - 10:08 PM

Please post your code here, using code tags: :code:. If you have a lot of code, a minimal viable (runnable) sample that illustrates your problem is best to post.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1