Today, my small calculator is finished. In addition to the automatically generated code, there are more than lines of code. Another basic function is not implemented, that is, to check the valid value range of the input number, therefore, when the number entered by the user is too large or the calculation result overflows, it will be abend. Now, this will be ignored for the time being.
Note from this encoding process:
1: The MessageBox function is MessageBox. Show ();
2: If you want to convert a decimal string to a numerical value, you cannot use Int. parse () instead of double. parse () or decimal. parse ();
3: The enumerated type is defined as public Enum opertor {Blank, add, sub, Mul, div}. In the future, the value to be referenced must use opertor op = opertor. Add;
4: Even if (I = 5), a compilation review mechanism that checks errors such as if (I = 5) is added, but similar
Bool new_num = true;
If (new_new = false)
This clearly indicates whether it is a false statement. It will be mistakenly written as a value assignment and will not be detected. Therefore, follow these rules:
If (new_num) or if (! New_num), instead of manually determining whether it is true or not, flase.
5: This implementation still uses the full structured programming thinking, I don't know how to use an object-oriented approach to implement an event-driven small transaction processing program like this ..... Which of the following should be abstracted as a class ....... Confused!
In addition, the special features of. Net/C # such as property, attribute, Delegate, reflect, and event are not used in this implementation process .......