...

View Full Version : help with my calculator please!



supacook2k
12-07-2006, 11:21 PM
i've designed a basic calculator and its working but not how i want it to. i've designed it (and dont want to change the design) so when the the user is inputting their calculation it all displays on the screen e.g. 1+3*5, now when someone puts a calculation in like that it does 3*5 then adds the 1 but i want it so it does the 1+3 first then multiplies by 5.

can anyone help?

thanks

Philip M
12-08-2006, 08:29 AM
You must put the addition in brackets if you want to alter the normal order of precedence in calculations:-

1+3*5 = 16 (multiplication is performed before addition)

(1+3)+5 = 20 (brackets force addition to be performed first)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum