Log in

View Full Version : Basic calculator


neo_lover2000
Jun 1, 2009, 07:18 PM
Mr Perito
thanks for taking time to help me.:):)
1 + 1 + 1 + 1

This the appearance of my calculator and how should it works

1. What I want to do is when I enter the first number it will be displayed on the Number 1 textbox.
2. press + to add the two number
3. when I enter the second number it will be displayed on the Number 2 textbox
4. when I press + sign again, It will add the first and second number and display the sum on Display textbox

it also display the sum to the Flag textbox, eventually the flag value will be displayed on the Number 1 textbox

I think the Flag textbox temporarily store the sum of the first two number as are getting ready to enter a new number to be added

Sir It somehow work as the calculator in window, when you are continuously adding number when you hit the plus button it display the sum automatically with out pressing the equal sign
[email protected]
[email protected]

sir about the flag thing my prof. give it as a clue.

Perito
Jun 1, 2009, 07:32 PM
It's a bad idea to enter your e-mail address. Spammers "harvest" e-mail addresses and you'll get millions of spam e-mail.



1 + 1 + 1 + 1

This the appearance of my calculator and how should it works

1. What I want to do is when I enter the first number it will be displayed on the Number 1 textbox.




2. press + to add the two number


You only have entered 1 number (in #1). There aren't 2 numbers to add.



3. when I enter the second number it will be displayed on the Number 2 textbox


OK. Then you have to know that the first number has been entered. A "flag" can tell you that -- or you could just look for a number in TextBox1.



4. when I press + sign again, It will add the first and second number and display the sum on Display textbox

it also display the sum to the Flag textbox, eventually the flag value will be displayed on the Number 1 textbox


What do you mean, eventually?



I think the Flag textbox temporarily store the sum of the first two number as are getting ready to enter a new number to be added

Sir It somehow work as the calculator in window, when you are continuously adding number when you hit the plus button it display the sum automatically with out pressing the equal sign.


I'll do some work on this in the morning for you. I think your fundamental problem is that you don't understand what you want the program to do.