Thursday, December 9, 2010

Calculator Part II

For the functions of the buttons the Calc engine is used. In the Calc engine we used preset mathematical buttons and applied them to what buttons we wanted to perform the function. Then we had to create private static final int such as MULTIPLY = 4, so when applying the function later we can use 4 to represent multiplying. We did this for squareroot and exponent. We also had to add the action listener to all the newly added buttons. There is also a series of long and complicated phrases and numbers to determine the text on the screen versus the last on screen and what needs to be on the screen. Then we added the operations squareroot and exponent to the list of operations and told teh calculator to get the function from the Calc engine.

No comments:

Post a Comment