calculator problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • traineeirishprogrammer
    New Member
    • Jul 2007
    • 24

    calculator problem

    I want to develop a calculator in javascript, like the one in microsoft;

    I cant get around the logic of it.

    Here is my problem. If I type in a number then I have to wait for an operator then I have to wait for another number to be typed in, Then I have to wait for the equals sign to evaluate the program.

    How can this be done.

    Hope you can understand my question?

    Thanks
  • Death Slaught
    Top Contributor
    • Aug 2007
    • 1137

    #2
    Originally posted by traineeirishpro grammer
    I want to develop a calculator in javascript, like the one in microsoft;

    I cant get around the logic of it.

    Here is my problem. If I type in a number then I have to wait for an operator then I have to wait for another number to be typed in, Then I have to wait for the equals sign to evaluate the program.

    How can this be done.

    Hope you can understand my question?

    Thanks
    By "operator" then I assume that you meen the multiplacation, addition, substraction, or division sign etc. but i dont really understand what you meen by "I have to wait" in a calculator you have to enter your number then the sign then your other number and then your equals button. So i dont really understand your question. but if you post your code we may be able to help you more.

    Thanks, Death Slaught

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, IP.

      Have a look at this thread for a complicated and a not-so-complicated solution.

      Comment

      Working...