This site requires JavaScript, please enable it in your browser!
Greenfoot back

Comments for Calculator

Return to Calculator

A new version of this scenario was uploaded on Wed Sep 25 21:25:15 UTC 2013
GreenHouseGreenHouse

2013/9/25

Cool :) a working calculator :D One bug: double press + - * or / and it will "java.lang.NumberFormatException: empty String" at Background.act(Background.java:82).
danpostdanpost

2013/9/25

@GreenHouse, I would not actually call it working. For example '9 + 9 =' followed by '+ 9 =' returns '45'; '+ 9 =' again returns '99'; and again '207'! But, then again, Ed.Betteridge did say it was buggy. Not bad for a first project, though. I expect impovements are forthcoming.
Ed.BetteridgeEd.Betteridge

2013/9/26

Thanks for your feedback guys! :) Any suggestions as to methods to improve it?
GreenHouseGreenHouse

2013/9/26

One main thing that could realy help you is: ScriptEngineManager manager = new ScriptEngineManager(); ScriptEngine engine = manager.getEngineByName("js"); Object result = engine.eval("3+4");
Ed.BetteridgeEd.Betteridge

2013/9/26

Thanks GreenHouse :) I considered using this when I was making it, but I felt it was like 'cheating' for some reason. I might end up having to use it.
A new version of this scenario was uploaded on Thu Sep 26 16:15:28 UTC 2013
A new version of this scenario was uploaded on Thu Sep 26 16:46:02 UTC 2013
Ed.BetteridgeEd.Betteridge

2013/9/27

Hi, this is my most working version, but unfortunately I overwrote it on my PC, is there any way to download it from here?
JetLennitJetLennit

2013/9/27

Decompile greenfoot.org/applet_attachments/0002/3519/greenfoot1693984861464170200.jar
danpostdanpost

2013/9/27

I had downloaded an earlier version of it. I could start a discussion and post the class codes there or you could supply your email address and I can get it to you that way.
GreenHouseGreenHouse

2013/9/28

Decompiled: http://www.file-upload.net/download-8121709/Calculator.zip.html
Ed.BetteridgeEd.Betteridge

2013/9/28

Thanks guys, you saved me there! :)
A new version of this scenario was uploaded on Sun Sep 29 12:01:51 UTC 2013
Ed.BetteridgeEd.Betteridge

2013/9/29

Thanks for all the help so far. This should be my last query about this :) http://www.greenfoot.org/topics/4528
A new version of this scenario was uploaded on Thu Oct 03 15:47:35 UTC 2013 Used .SetScale() Successfully
A new version of this scenario was uploaded on Thu Oct 03 15:51:54 UTC 2013 Revert Back to Different Version
A new version of this scenario was uploaded on Thu Oct 03 15:59:45 UTC 2013 Nothing
JetLennitJetLennit

2013/12/17

@GreenHouse, what decompiler did you use?
JetLennitJetLennit

2013/12/17

Never Mind