Showing posts with label simple. Show all posts
Showing posts with label simple. Show all posts

Saturday, June 4, 2011

A simple calculator

I haven't finished the project yet. Only managed to do the addition function. The rest should be very similar.
I created a procedure called "buttonpressed" to process the numbers each time the buttons are pressed. See screen captures which are self-explanatory.

(A) Defining the global variables













 (B) Calling the "ButtonPressed" procedure each time a number button is pressed:












  (C) The "ButtonPressed" procedure

















(D) Other buttons like the "Plus", "Equal" and "AC" buttons: