Programming Example: Calculator


This program, which simulates the functionality of the Windows Calculator, incorporates the following:


This sample program was originally given as a student exercise, with the specifications as follows:


Write a VB program that simulates the basic functions and behavior of the Windows calculator program.  To study its interface, you can run it by clicking the Start button on the taskbar, then go to Programs, then Accessories.  Shown below is a screen-shot of the Windows Calculator:



You should at least support the basic functions of addition, subtraction, and multiplication, as well as changing the sign of the number (the +/- key).  It's up to you if you want to support the sqrt, %, and 1/x functions.  Don't bother with the "M" keys on the left (MC, MR, MS, M+) or the scientific features. Shown below is my implementation of the Calculator:



Download the solution for this project here.