201571030118/201571030128 "Four arithmetic exercises software for Primary School" peer project report,
The source code is linked to the Github repository homepage.
Https://github.com/devilwjy/Second
A. Requirement Analysis:
(1) overall requirement: The computer selects 20 random addition, subtraction, multiplication, division, and hybrid formulas from the question library file. The user inputs the formula answer. The program checks whether the answer is correct. Each question is correctly calculated as 5 points, no score for errors. The total score is given after 20 tests;
(2) The question library file can be automatically generated in Experiment 2 or manually edited and generated. The text format is as follows:
(3) The program provides you with three advanced arithmetic exercises: integer formula (required) within, Parentheses, and real score calculation;
(4) The program allows you to perform multiple rounds of tests and provides a column chart of users' scores for multiple rounds of tests. The example is as follows:
(5) The program records the user's answer results. When the program exits and starts again, it can display the user's last test results and ask whether the user can perform a new test;
(6) The timing function is provided. The time consumed after the user starts to answer questions is dynamically displayed during the test.
(7) the man-machine interface of the program is a GUI interface (both WEB pages and APP pages). The interface supports Simplified Chinese (mandatory)/Traditional Chinese/English. You can select a language.
B. Software Design:
Main functions of each module:
(1) Main () Class: generate an expression using the calculate class, and call the selection module, that is, the Select () class.
(2) Select (): log on to the user and Select whether to answer the integer question or the score question.
(3) Test () Class: generate the user answer interface.
(4) Summer (): displays the current round of scores, prints incorrect questions and answers, and allows the user to choose whether to perform the next round of questions or to view the problem.
(5) Histogram () Class: draws a Statistical Chart for each round.
(6) TimerThread () Class: Provides the timing function.
C. Core Function Code display:
1. The following Code draws a Statistical Chart: The main method is to add a Jpanel to a JFrame, add a rectangular box and a Label to the Jpane.
Public Histogram (final ArrayList <String> summer) {length = summer. size (); count = new int [length]; System. out. print (length); this. setLayout (null); for (int I = 0; I <summer. size (); I ++) {count [I] = Integer. parseInt (summer. get (I) ;}for (int I = 1; I <summer. size (); I = I + 2) {JLabel Label = new JLabel ("th" + (I + 1)/2) + "Wheel", JLabel. LEFT); Label. setFont (new Font ("SansSerif", Font. BOLD + Font. ITALIC, 18); Label. setBounds (30 + (I-1) * 30,610, 60, 50); JLabel Label2 = new JLabel (count [I] + "", JLabel. CENTER); Label2.setFont (new Font ("SansSerif", Font. BOLD + Font. ITALIC, 18); Label2.setBounds (25 + (I-1) * 30,555-6 * count [I], 60, 50); label. add (Label); label. add (Label2); this. add (label. get (I-1); this. add (label. get (I) ;}} protected void paintComponent (Graphics g) {int x = 10; g. setColor (Color. red); for (int I = 0; I <count. length; I ++) {g. fillRect (x, 600-6 * count [I], * count [I]); x + = 30 ;}}
2. The following code shows the Answer time (a new JFrame is created to display it, but it must be set to the top of the list ).
Public class TimerThread extends JFrame implements Runnable {private JFrame frame; private JPanel timePanel; private JLabel timeLabel; private JLabel displayArea; private String DEFAULT_TIME_FORMAT = "HH: mm: ss "; private int ONE_SECOND = 1000; int time = 1; boolean isRun = true; public TimerThread () {timePanel = new JPanel (); timeLabel = new JLabel ("your current time: "); displayArea = new JLabel (); timePanel. add (timeLabel); timePanel. add (displayArea); this. add (timePanel); this. setdefaclocloseoperation (EXIT_ON_CLOSE); this. setBounds (800,100,200, 80);} public void run () {while (isRun) {try {displayArea. setText (time + "s"); time ++; Thread. sleep (1000);} catch (InterruptedException e) {e. printStackTrace ();}}}}
D. Run the program: each functional interface when the program is running.
1. Enter the student ID and password, and select the answer score or INTEGER:
2. If you select an integer, start answering questions and timing (the picture is large and cannot be placed ).
3. view the score and time, and display the wrong question and answer (the picture is large and cannot be placed ).
4. Another round:
5. If you select a score:
6. view the minute and time:
7. After multiple rounds of tests, summarize the statistical charts as follows:
E. Describe the pairing process and provide a pair of photos (non-pendulum photos) for the two to discuss, refine, and program ).
F. PSP for this pair operation
PSP2.1 |
Task content |
Time required for completion of the plan (min) |
Time required for actual completion (min) |
Planning |
Plan |
60 |
100 |
· Estimate |
· Estimate the time required for this task and plan the general steps |
60 |
100 |
Development |
Development |
890 |
1256 |
· Analysis |
Demand Analysis (including learning new technologies) |
6 |
10 |
· Design Spec |
· Generate design documents |
30 |
20 |
· Design Review |
· Design Review (review design documents with colleagues) |
4 |
6 |
· Coding Standard |
Code specification (develop appropriate specifications for current development) |
30 |
20 |
· Design |
Specific design |
100 |
150 |
· Coding |
Code |
600 |
700 |
· Code Review |
· Code review |
120 |
200 |
· Test |
· Testing (self-testing, code modification, and modification submission) |
100 |
150 |
Reporting |
Report |
38 |
32 |
· Test Report |
· Test report |
3 |
2 |
· Size Measurement |
Computing workload |
5 |
10 |
· Postmortem & Process Improvement Plan |
· Summarize afterwards and propose a process improvement plan |
30 |
20 |
G. Please use the Hamburg evaluation method to give some comments to your friends.
At the beginning, we all talked about their respective ideas for designing this project, which is basically the same. We can take advantages and convenience for a slightly different idea. It can be said that the cooperation is quite tacit, not who wrote it, but a person who looks at a person to write it, discuss the problem, discuss it, and Baidu. At the beginning, I felt that the division of labor was good and the efficiency was high, but after cooperation, I found that this was not the case. A person would be sloppy or confused, and then stuck there, when writing together, you should pay attention to whether the other party has made a mistake, or you can discuss it if you don't know it, and you will be able to understand the problem as soon as possible. The point is that my friend is very patient and listens carefully to my ideas. Besides, I typed slowly and prone to mistakes. She always reminded me. She has a strong hands-on ability and fast response. I think she sometimes cannot write more quickly. Every time we write code, she is very positive. In a word, she works very well, better friends! We are looking forward to cooperating with her next time! (Note: Our dormitory is next door, and we discuss and write in the dormitory every day, so there is basically no code transferred on github)
H. Does pairing programming really bring the effects of 1 + 1> 2? Through this pair programming, please talk about your feelings and experiences.
Yes, this is absolutely true. For example, (1) My friend told me to write the code we wrote for a while and send it to her. Otherwise, I would lose it, I think it's okay, but I can't lose it. As a result, the code in the class was really lost the next day and I wrote it again. The only idea is to hear how good she is. (2) when I write code, I always get sloppy. A small problem is so sloppy. It is similar to the array overflow error. The program reports an error, because of the large amount of program code, I checked it for several hours. With a reminder from my friends, I almost lost the number of errors. (3) Sometimes I write code, the running result is not what I imagined. Then I reviewed the code again with my friends and found out where to put it. If I review it by myself, the first viewer will be clear, and I will follow the wrong idea. Second, I will not be able to respond when I find it. (4) When there are many components in the design field, one person cannot keep an eye on them. (5) I wrote a response that failed to come or get tired. She then wrote it. Otherwise, the brain will not keep up with the pace. I won't give a few examples. The examples above show that I have saved a lot of time in this code because of the small partner relationship. In addition, I am very satisfied with the design interface. We have been calculating the position of the component, and it looks simple and generous.