. Net/C # exercise calculator (win forms) (2)

Source: Internet
Author: User

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 .......

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.