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

2013/11/11

Help

RedFox92 RedFox92

2013/11/11

#
Im trying to make a Calculator and I don't know how to start.( If possible could you also explain. I would like to understand, so I could do it on my own) I just want it to be able to do: Addition Subtraction Multiplication Division Memory Store Memory Recall Memory Clear Memory
danpost danpost

2013/11/11

#
Start by first creating a world class for the calculator and the actor classes for the buttons and the display. You do not have to create a separate class for each button. All you need do is add an instance field in the class of the button that will be set to a distinguishing value (this could just be the String value that the button will have -- "1", "2", "+", "MR", "CE", etc.).
RedFox92 RedFox92

2013/11/11

#
Sorry whats an instance field
danpost danpost

2013/11/11

#
Please refer to the Java tutorials -- especially the trail on Learning the Java Language.
RedFox92 RedFox92

2013/11/11

#
Will the java work with Greenfoot i know that its Java.Greenfoot but isnt the code different
SPower SPower

2013/11/11

#
Greenfoot is just a set of tools and an API (the classes Greenfoot, GreenfootImage etc.) written in/for Java, so everything you write in Java will work in greenfoot. It's just that you have some extras with Greenfoot as opposed to clean Java.
You need to login to post a reply.