C # basic Video tutorial 4.3 How to write a simple calculator

Source: Internet
Author: User

We went on to change, in order to make this calculator more practical, we have to like the official calculator can continue to calculate (after you calculate a piece of data, you can then add to the decrement, we temporarily do not consider parentheses, priority, and so on, because most of the time we open the calculator is to carry out the simple arithmetic), Of course, we need a click after each time to calculate ( Microsoft Official is calculated, press the number key again by default to start the calculation, similar to the click to clear, press the subtraction key again to calculate, similar to click on the calculation ), the reader can think about how to do more intelligent, More Automatic

?

Add the Undo button (BACKSPACE), to do some processing, because if there is no more things you can not go back to the lattice (also to determine whether the current is to backspace a or backspace b), from this section, "then calculate" and "undo" two functions can be seen, because we have the entire logic flow in the previous carding of the relatively clear, Here just add extra love some else if judgment on it, the reader can try to start from scratch to write a calculator, to see their final entire program structure is disorderly, good change.

?

We can also add the vector point multiplication and the cross-multiplication function, in order to be separated from the existing simple calculator, may be possible to create some new text box to enter the output (perhaps also should add matrix operation, three points for the center, the area for volume and so on, then do not put in here to talk, talk about not finish)

?

We can also add the function of the conversion (due to the time limit, we do not make the whole calculator very complete, most of the function is only the test available on the line)

?

Convert the front angle radians (his business logic follow-up conversion is very similar, so can be grouped together)

?

Perhaps also should respond to the mouse keyboard events (you keyboard by the number key, the same as press button), you can also increase the RMB capital conversion (learn to use other people's Class), voice playback (learn to transplant others code) and so on, not in detail, interested readers can see this section provides the attachment code to study how others do , what are the pros and cons (as described in the first section of this tutorial, C # No matter in which field there are a large number of ready-made examples can be consulted, understand others, absorbing, revising changes to make suitable for their own, this is what C # the thing to do)

?

Summary: This course is a long one because it is the first introductory example, so it's very thin and divided into three parts. The following introduction will be more and more sketchy (give ideas, give code, focus on, the rest of their own pondering). Here are a few points to understand:

1 Basic control use, understand how C # is to make the interface (button, text box, temporarily do not study complex interface design, interactive mode)

2 The way of thinking that separates the presentation layer from the operational layer (extracting all the functions associated with the data into a class, and constantly perfecting its own class library)

3 testing to improve the difficulty of perfecting your code, porting someone else's code, copying someone else's good design to do

?

?

For more instructional videos and downloads, please pay attention to the following information:

My Youku Space:

Http://i.youku.com/acetaohai123

?

My online forum:

http://csrobot.gz01.bdysite.com/

?

Problem Exchange:

qq:910358960

Email:[email protected]

?

?

?

C # basic Video tutorial 4.3 How to write a simple calculator

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.