Link to home
Start Free TrialLog in
Avatar of pc_rails
pc_rails

asked on

memory buttons for basic calculator

I am leaning how to program in visual basic .net.  I am writing program to build a basic calculator.  This calculator has memory buttons (MR, M+, M- MCL) along with the basic percent, add, subtract, multiply and divide operation buttons.  

I am wondering if someone has a good example for coding the PERCENT and the MEMORY operations for a basic calculator.  Ive found some code online but they exclude the percent and the memory buttons.  Im hoping for something basic.  Im not ready to get fancy just yet.  Thanks!
Avatar of VBClassicGuy
VBClassicGuy
Flag of United States of America image

Just define a real number that is global to hold the "memory number". The MR button should replace what's in your text or display box with the memory number. The M+ button should add what's displayed to the memory number, then update the number. Same scenario for the M- button. MCL should set the global memory number to zero.
ASKER CERTIFIED SOLUTION
Avatar of game-master
game-master
Flag of Philippines image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial