2017-2018-2 1723 "Java Programming" course pair programming Exercises _ arithmetic

Source: Internet
Author: User
Tags arithmetic

2017-2018-2 1723 "Java Programming" course pair programming Exercises _ Arithmetic Group members
    • 20172327 Marian
    • 20172320 Li Shu
    • 20172317 Shing
Demand analysis
    • Automatically generate problems
      • can be used independently (able to write the function of the test class to create a separate problem)
      • can generate different levels of problems
        • Different levels of topics should refer to different difficulty topics, which means that the complexity of the topic increases with the level of the increase
    • Problem calculation (question)
      • can be used independently
      • Implement infix expression to postfix expression and calculate
        • The automatically generated topic is converted to a suffix expression, and the suffix expression is evaluated
      • Judge the user's answer correctly and output the correct result
        • You should support the input of the score form to the user's answer
    • Support True Score
      • can be used independently
      • Realization of the calculation of fractional formulas
        • The generated topic can have a true score, the user's answer input to support the input of the score
    • Topic go Heavy (expand demand, add sub-item)
      • can be used independently
      • Implement the de-weight of auto-generated expressions
Design ideas (approximate) How to achieve random generation problems

The first generation is the infix expression of the topic, and then each level of the topic will be in the complexity of the change.
For example, the first-level topic is the simplest of two operands and one operator type: x#y (#代表随机的一个运算符)
The two-level topic is three operands plus two operators, and it is possible to generate true fractions as operands: x#y#z; the condition in which a true score is generated is determined by whether a random number satisfies a condition
Level three topics are similar to level two, but with parentheses, but in order to prevent the random generation of parentheses causing problems such as "1+2", the position of the brackets is fixed: (x#y) #z; late may try to randomly generate different fixed position brackets

How to implement the problem calculation

Use the stack to convert infix expression to postfix expression, and then use the suffix expression to calculate the value

    • unresolved issues that are encountered here :
      • With the suffix expression to calculate the results of the time there may be a problem, according to the teacher to the method, may occur when the "/" number of the return of the stack is a decimal, the decimal is estimated to be a problem in the stack
How to achieve "support true score"

There are two scenarios for supporting true scores: True scores appear in the topic, and the input that supports the user is a true score
For real scores in the title:

    • Because "/" will be confused, do not know whether the score is the horizontal or division sign, so a plan is to put the score in parentheses as a whole to deal with, for example (1/2) is the score One-second, and 1/2 is a divided by two. But the other way to do this is to use the symbol in the middle of the upper and lower points as the division sign, and the "/" as a fraction of the horizontal, so as to distinguish, but has not yet finally decided
    • The generation of true fractions is an adaptation of the Rationalnumber class of example 7.4 in the book.
      For the use of answer-compatible true scores:
    • First of all, since there may be 13/2 or something like that, so here's the answer. The use of compatible fractions is better
    • The tentative idea is to use the StringTokenizer to determine if your input is a fractional expression, and if yes, calculate the fractional expression (perhaps a simpler method)
Related processes

Since it is not fully ready, the code may change dramatically in the late stages, so it is for reference only





UML diagram

Well, it's messy, but it'll change later.

Comments on the rest of the team.

I think it's OK.

Psp
PSP2.1 Personal software Process Stages Estimated time-consuming (minutes) actual time elapsed (minutes)
Planning Plan 60 60
Estimate Estimate how long this task will take 100 100
Development Development 800
Analysis Demand analysis (including learning new technologies) 100
Coding Standard Code specification (to develop appropriate specifications for current development) 30
Design UML Design Project UML class diagram 50
Coding Specific code 30
Code Review Code review 50
Test Test (self-test, modify code, commit changes) 30
Size Measurement Calculation effort (actual time) 30
Postmortem & Process Improvement Plan Summarize afterwards and propose process improvement plan 30
Total 1240
This week's summary

This week has passed, the train of thought is still unclear, encountered a lot of difficult problems
I may not be very good at programming this line, can not learn

2017-2018-2 1723 "Java Programming" course pair programming Exercises _ arithmetic

Related Article

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.