2017-2018-2 20172310 "Java Programming" course pair programming Exercises _ arithmetic _ second week

Source: Internet
Author: User
Tags arithmetic

2017-2018-2 20172310 "Java Programming" course pair programming Exercises _ arithmetic _ Second week blog requirements

Students in the group need to publish their own blog
The blog should contain the following content:
Related processes
Key code Explanation
Difficulties encountered and their solutions
Write the part of the project that you are responsible for
Division of individual contribution (percentage contribution to each member of the group, contribution of each member to 100%)
Make a comment on a pair of small partners blog links (Focus on where to improve)
The code Cloud link for the project
Give group pair programming photos
If you want to show the team's common results in the blog content, please explain
If you have a reference or reference to the design, implementation, please explain

Explanation of the key code
    • The key code to build the part of the expression:
      Written in last week's blog: 2017-2018-2 20172310 "Java Programming" course pair programming Exercises _ arithmetic _ first week

    • The key code for the part of the infix expression to the suffix expression:



The design idea is: first create a two-dimensional array as the basis for judging operator level, and then instantiate a StringTokenizer class object, the resulting expression as a string into the St, and a space as a separator.

The use of StringTokenizer is

Then determine whether a is stored in the operator, and then according to the infix suffix of the rules to encode.

    • The key code for the part of the suffix expression calculation:


The problems encountered
    • Prior to our thinking, when the user enters the answer, we let the user enter the numerator, the denominator separately,
    • Solution: This kind of input method is inconvenient, also does not favor the application of the program. The code is then modified.

This is the effect after the modification.

    • In implementing a loop of the expression, I encountered a problem that is-how to put a string into a string, is to implement the concatenation of strings, to achieve the purpose of the loop.

      It is only possible to use + = when the numeric value of int is used, and the string can also use + =? I made an attempt.
Own part of the responsibility

In fact, this week's own contribution value is really very low (mainly this week on the weekend spent a day on the  ̄▽ ̄) ~*

2017-2018-2 20172310 "Java Programming" course pair programming Exercises _ arithmetic _ second week

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.