结对编程 201521123027

一、结对编程成员信息

二、结对编程结果

  • 流程图

  • 运行截图

  • 核心代码
计时器代码
private boolean isRun = false;
     private MyRunable myTimeRunable = new MyRunable();
     private class MyRunable implements Runnable{
            private int hour = 0;
            private int min = 0;
            private int sec = 0;
            private NumberFormat format = NumberFormat.getInstance();
            private String nextSecond(){
                ++sec;
                if(sec == 60) {
                    ++min;
                    sec = 0;
                }
                 
                if(min == 60) {
                    ++hour;
                    min = 0;
                }
                return currentTime();
            }
             
            private String currentTime(){
                return format.format(hour)+":"+format.format(min)+":"+format.format(sec);
            }
             
            @Override
            public void run() {
                format.setMinimumIntegerDigits(2);
                format.setGroupingUsed(false);
                while(true) {
                    if(rootPaneCheckingEnabled) {
                        if(isRun) {
                            nextSecond();
                            jLabel4.setText(currentTime());
                        }
                    }
                    try {
                        Thread.sleep(1000);
                    }catch (InterruptedException e) {
                    }
                }
            }
             
        }

三、结对编程过程

  • 码云提交

  • 结对编程照片

  • 测评

四、结对编程小结

由于个人编代码能力较差,所以个人觉得此次结对编程过程有点难受,一开始不知道要怎么弄,还好有一个强的队友,可以和他一起讨论、一起解决遇到的困难。拿着上一届学姐的代码,也有发现一些bug,但是有的不知道如何修改,实在是没有办法!希望可以一点一点加强自己吧。
另外,结对编程的方式的确会带来一些好处:减少个人的代码量,可以一起督促对方、鼓励对方。总之,还是会起到1+1>2的效果!

posted on 2018-03-25 20:50  clclcl  阅读(216)  评论(0编辑  收藏  举报

导航