The first unit summary BUAA_OO

1. Simple derivative polynomials

   The first difficulty of the job, I think, in particular, the regular use of pre-processing the input expression. The idea of ​​the job is: firstly an expression pretreatment (because the title will not be required to produce WF space, so you can rest assured that bold to eliminate spaces).

    After eliminating the space for analytical expression, the expression is divided into determination, and storing the index and the coefficient, the index and coefficients are placed in two containers.

    After parsing is a derivative operation, here it is my method to operate a digital container, and finally obtained the new coefficient index.

    The easiest card bug where output is an expression of, accidentally, in some places when optimizing forget to consider, will be in gg in household toilet.

    Here is the class diagram first job I use.

2. A more complex polynomial derivation

    Difficulties second job, determines that the WF, the use of cos, sin derivation, and the product rule.

    WF judgment: As more types of errors, and countless, so my method is used here only to determine the correct input. With a super regular input to determine whether the correct input. If not directly WF out, the program ends; if so, then the pre-series of activities.

    Of cos, sin derivation, this method of analysis I used only the exponent, which factor is regarded as a new entry operation, this advantage is reduced cos, sin difficult to find a single guide, makes the code more concise and clear.

    Use the product rule, deal with me here at the expense of optimization to ensure accuracy, so only the most basic optimization. Because the product of the law, so I used the idea: each one there is a multiplying operation String container, each of the guide there are also a number of String container, needed to identify the elements in the derivation carried out It can be.

    The following is a class diagram of the second job.

3. The derivative function Nested

    The main is a regular expression matching the job. The method I used is: Code reference in previous years, to get ideas. (In many cases, a person's thoughts will be very immature, learn from previous years codes, get help from teachers and students there, to find ideas, but not plagiarism, I think it is a part of the inevitable process of learning.)

    Here is the class diagram of this job.

4.bug analysis.

    Adding a bug analysis to help future music.brothers be debug.

    First job: bug focused on a particular type of print consideration, the most typical data: -x ** - 1, x ** - 1 on both sets of data.

    Second job: bug focused on the symbol processing, the most typical representative is the symbol repetition processing (derivation of dealing once, when output and processing time), and later optimized afternoon, only to find themselves find out all the bug.

   Third operation: Due to the excellent reference of previous codes, so the bug was significantly reduced.

5. Some feel

    emmmmmmm, feel the pressure is still there, I hope to be able to get rid of the habit of procrastination, every job at OO hurry to complete it, do not drag the DDL, which is the most important point.

    There is a sense of "object-oriented" thinking, deepen a little bit of understanding.

Guess you like

Origin www.cnblogs.com/alink61/p/12536420.html