结对编程个人项目分析

项目需求

个人项目:中小学数学卷子自动生成程序

用户:

小学、初中和高中数学老师。

功能:

1、命令行输入用户名和密码,两者之间用空格隔开(程序预设小学、初中和高中各三个账号,具体见附表),如果用户名和密码都正确,将根据账户类型显示“当前选择为XX出题”,XX为小学、初中和高中三个选项中的一个。否则提示“请输入正确的用户名、密码”,重新输入用户名、密码;

2、登录后,系统提示“准备生成XX数学题目,请输入生成题目数量(输入-1将退出当前用户,重新登录):”,XX为小学、初中和高中三个选项中的一个,用户输入所需出的卷子的题目数量,系统默认将根据账号类型进行出题。每道题目的操作数在1-5个之间,操作数取值范围为1-100;

3、题目数量的有效输入范围是“10-30”(含10,30,或-1退出登录),程序根据输入的题目数量生成符合小学、初中和高中难度的题目的卷子(具体要求见附表)。同一个老师的卷子中的题目不能与以前的已生成的卷子中的题目重复(以指定文件夹下存在的文件为准,见5);

4、在登录状态下,如果用户需要切换类型选项,命令行输入“切换为XX”,XX为小学、初中和高中三个选项中的一个,输入项不符合要求时,程序控制台提示“请输入小学、初中和高中三个选项中的一个”;输入正确后,显示“”系统提示“准备生成XX数学题目,请输入生成题目数量”,用户输入所需出的卷子的题目数量,系统新设置的类型进行出题;

5、生成的题目将以“年-月-日-时-分-秒.txt”的形式保存,每个账号一个文件夹。每道题目有题号,每题之间空一行;

6、个人项目9月17日早上8点以前提交至各自负责的助教处。提交方式:工程文件打包,压缩包名为“几班+姓名.rar”。

附表-1:账户、密码


账户类型


账户


密码


备注


小学


张三1


123


张三2


123


张三3


123


初中


李四1


123


李四2


123


李四3


123


高中


王五1


123


王五2


123


王五3


123

附表-2:小学、初中、高中题目难度要求


小学


初中


高中


难度要求


+,-,*./


平方,开根号


sin,cos,tan


备注


只能有+,-,*./和()


题目中至少有一个平方或开根号的运算符


题目中至少有一个sin,cos或tan的运算符

代码分析

优点

使用结构体对用户信息进行初始化,十分方便

struct Student
{
    char name[20];
    char degree[5];
    char password[20];
};

Student stu[9] ={{"张三1","小学","123"},{"张三2","小学","123"},{"张三3","小学","123"},
                 {"李四1","初中","123"},{"李四2","初中","123"},{"李四3","初中","123"},
                 {"王五1","高中","123"},{"王五2","高中","123"},{"王五1","高中","123"}};

反例

class UserDB{
public:
    string name;
    string password;
    string grade;
};
UserDB user_db[9];
void load_db(){
    user_db[0].name="张三1";
    user_db[0].password="123";
    user_db[0].grade="小学";

    user_db[1].name="张三2";
    user_db[1].password="123";
    user_db[1].grade="小学";

    user_db[2].name="张三3";
    user_db[2].password="123";
    user_db[2].grade="小学";

    user_db[3].name="李四1";
    user_db[3].password="123";
    user_db[3].grade="初中";

    user_db[4].name="李四2";
    user_db[4].password="123";
    user_db[4].grade="初中";

    user_db[5].name="李四3";
    user_db[5].password="123";
    user_db[5].grade="初中";

    user_db[6].name="王五1";
    user_db[6].password="123";
    user_db[6].grade="高中";

    user_db[7].name="王五2";
    user_db[7].password="123";
    user_db[7].grade="高中";

    user_db[8].name="王五3";
    user_db[8].password="123";
    user_db[8].grade="高中";
}

使用strftime函数获取格式化日期信息

static string getCurrentTimeStr()
{
    time_t t = time(NULL);
    char ch[64] = {0};
    strftime(ch, sizeof(ch) - 1, "%Y-%m-%d-%H-%M-%S", localtime(&t));     //年-月-日-时-分-秒
    return ch;
}

  strftime是一种计算机函数,根据区域设置格式化本地时间/日期,函数的功能将时间格式化,或者说格式化一个时间字符串。我们可以根据format指向字符串中格式命令把timeptr中保存的时间信息放在strDest指向的字符串中,最多向strDest中存放maxsize个字符。该函数返回向strDest指向的字符串中放置的字符数。

  头文件:time.h

size_t strftime(
char *strDest,
size_t maxsize,
const char *format,
const  struct tm *timeptr
);

出题逻辑完整,能随机生成任意形式的题目

1.cos(7)+32+cos(tan(17))*cos(cos(tan(20)))

2.cos(76)+5-32+sin(cos(66))+cos(sin(cos(96)))

3.√(cos(5))*cos(tan(47))/√(cos(cos(tan(81))))

4.tan(25)+tan(41)+tan(75)

5.√(73)*89/53/tan(63)-√(tan(93))

6.tan(sin(cos(tan(18))))/sin(cos(tan(95)))

7.sin(tan(sin(tan(82))))

8.cos(47)-cos(63)

9.√(sin(sin(57)))/sin(19)

10.√(sin(sin(cos(tan(87)))))/sin(cos(tan(46)))

11.(cos(64))/77/sin(cos(1))^2 -(cos(sin(cos(77)))^2 )

12.sin(tan(sin(tan(5))))

13.35*(58)*73/tan(40)/tan(27)

14.√(sin(sin(tan(51))))

15.(√(sin(cos(32))))*sin(cos(35))-sin(cos(sin(cos(1))))^2 

16.√(tan(sin(tan(29))))-sin(tan(95))

17.tan(sin(cos(tan(2))))

18.57/cos(23)*cos(82)

19.√(sin(tan(sin(tan(14)))))/sin(tan(33))

20.tan(tan(56))

21.(6)/tan(39)-tan(54)

22.cos(tan(100))+55*cos(tan(70))-cos(tan(cos(tan(60))))

23.38*56/tan(75)*tan(53)

24.(tan(61))-sin(tan(29)^2 )-(sin(tan(54)))^2 

25.(35)/tan(22)^2 /(tan(37))^2 

26.(59)+sin(cos(tan(62)^2 ))/(sin(cos(tan(97))))^2 

27.17*(37)-64-sin(19)/sin(92)

28.49-(11)+cos(tan(36))*cos(tan(77))

29.tan(sin(tan(47)))

30.sin(93)+sin(55)/sin(74)

缺点

出题函数长达500行,将小学、初中、高中题目完全分开,导致了大量功能相似的代码行

  1 void Chuti(Student stu,char *degree0,int num)
  2 {
  3     int num0=1;
  4     cout<<degree0<<"出题成功"<<endl;
  5     srand((unsigned)time(NULL));
  6     ofstream outfile;
  7     const char *filename1=getCurrentTimeStr().c_str();
  8     char filename[100]="";
  9     strcat(filename,filename1);
 10     strcat(filename,".txt");
 11     char path[100]="";
 12     char *xiegang="\\\\";
 13     const char *file=getFile();
 14     strcat(path,file);
 15     strcat(path,stu.name);
 16     char path0[100]="";
 17
 18     strcat(path,xiegang);
 19     strcat(path,degree0);
 20     strcpy(path0,path);
 21     strcat(path,xiegang);
 22     strcat(path,filename);
 23     outfile.open(path);
 24     if(!outfile)
 25     {
 26         char command[100]="mkdir ";
 27         strcat(command,stu.name);
 28         strcat(command,xiegang);
 29         strcat(command,degree0);
 30         system(command);
 31         outfile.open(path);
 32     }
 33     if(strcmp(degree0,"小学")==0)
 34     {
 35         while(num0<=num)
 36         {
 37             outfile<<num0<<‘.‘;
 38             int cznum=rand()%5+1;
 39             bool kuohao=rand()%2;
 40             bool shoukuohao=0;
 41
 42             if (cznum<3)
 43             {
 44                 kuohao=0;
 45             }
 46             int count=0;
 47             int kuohaouse=0;
 48             int cznum0=cznum-1;
 49             while(cznum--)
 50             {
 51                 bool choose0=rand()%2;
 52                 bool choose1=rand()%2;
 53                 int temp=rand()%100+1;
 54                 int jjcc=rand()%4+1;
 55                 if(kuohao&&cznum>=2&&choose0&&!kuohaouse)
 56                 {
 57                     outfile<<"(";
 58                     kuohaouse=1;
 59                     if(cznum0==cznum)
 60                     {
 61                         shoukuohao=1;
 62                     }
 63                 }
 64                 outfile<<temp;
 65                 count++;
 66                 if(kuohao&&kuohaouse&&choose1&&count>=2)
 67                 {
 68                     outfile<<")";
 69                     kuohao=0;
 70                     kuohaouse=0;
 71                 }
 72                 if(kuohao&&kuohaouse&&cznum==0)
 73                 {
 74                     outfile<<")";
 75                     kuohaouse=0;
 76                 }
 77                 if(shoukuohao&&kuohaouse&&cznum==1)
 78                 {
 79                     outfile<<")";
 80                     kuohaouse=0;
 81                 }
 82                 if(cznum>0)
 83                 {
 84                     if(jjcc==1) outfile<<"+";
 85                     else if(jjcc==2) outfile<<"-";
 86                     else if(jjcc==3) outfile<<"*";
 87                     else if(jjcc==4) outfile<<"/";
 88                 }
 89             }
 90             num0++;
 91             outfile<<endl<<endl;
 92         }
 93     }
 94     if(strcmp(degree0,"初中")==0)
 95     {
 96         while(num0<=num)
 97         {
 98         //    bool kuohao=rand()%2+1;
 99
100             bool pingfang=rand()%2;
101             bool genhao=rand()%2;
102             while(!(pingfang||genhao))
103             {
104                 pingfang=rand()%2;
105                 genhao=rand()%2;
106             }
107             outfile<<num0<<‘.‘;
108             int cznum=rand()%5+1;
109             bool kuohao=rand()%2;
110             bool shoukuohao=0;
111
112             bool pingfangout=rand()%2;
113             bool genhaoout=rand()%2;
114
115             bool pingfanguse=0;
116             bool genhaouse=0;
117
118             int numkh=0;
119             if (cznum<3)
120             {
121                 kuohao=0;
122             }
123             int count0=0;
124             int count1=0;
125             int count=0;
126             int kuohaouse=0;
127             int cznum0=cznum-1;
128             while(cznum--)
129             {
130
131                 bool choose0=rand()%2;
132                 bool choose1=rand()%2;
133                 int temp=rand()%100+1;
134                 int jjcc=rand()%4+1;
135                 if(pingfang&&pingfangout&&!pingfanguse)
136                 {
137                     outfile<<"(";
138                     numkh++;
139                     pingfanguse=1;
140                 }
141
142                 if(genhao&&genhaoout&&!genhaouse)
143                 {
144                     outfile<<"√(";
145                     numkh++;
146                     genhaouse=1;
147                 }
148
149                 if(cznum==0||cznum==1)
150                 {
151                     if(pingfang==1)
152                     {
153                         outfile<<"(";
154                         numkh++;
155                         pingfanguse=1;
156                     }
157                     if(genhao==1)
158                     {
159                         outfile<<"√(";
160                         numkh++;
161                         genhaouse=1;
162                     }
163                 }
164
165
166
167                 if(kuohao&&cznum>=2&&choose0&&!kuohaouse)
168                 {
169                     outfile<<"(";
170                     numkh++;
171                     kuohaouse=1;
172                     if(cznum0==cznum)
173                     {
174                         shoukuohao=1;
175                     }
176                 }
177                 outfile<<temp;
178                 count++;
179                 count0++;
180                 count1++;
181
182                 if(genhao&&genhaouse&&cznum==0&&numkh>0)
183                 {
184                     outfile<<")";
185                     numkh--;
186                     genhaouse=0;
187                 }
188                 if(genhao&&genhaoout&&genhaouse&&count1>=1&&numkh>0)
189                 {
190                     outfile<<")";
191                     numkh--;
192                     genhaouse=0;
193                     count1=0;
194                 }
195
196                 if(pingfanguse&&cznum==0&&numkh>0)
197                 {
198                     outfile<<")^2 ";
199                     numkh--;
200                     pingfanguse=0;
201                 }
202                 if(pingfang&&pingfangout&&pingfanguse&&count0>=1&&numkh>0)
203                 {
204                     outfile<<")^2 ";
205                     numkh--;
206                     pingfanguse=0;
207                     count0=0;
208                 }
209
210                 if(kuohao&&kuohaouse&&choose1&&count>=2&&numkh>0)
211                 {
212                     outfile<<")";
213                     numkh--;
214                     kuohaouse=0;
215                     count=0;
216                 }
217                 if(kuohao&&kuohaouse&&cznum==0&&numkh>0)
218                 {
219                     outfile<<")";
220                     numkh--;
221                     kuohaouse=0;
222                 }
223                 if(shoukuohao&&kuohaouse&&cznum==1&&numkh>0)
224                 {
225                     outfile<<")";
226                     numkh--;
227                     kuohaouse=0;
228                 }
229
230                 while(numkh>0)
231                 {
232                     numkh--;
233                     outfile<<")";
234
235                 }
236
237                 if(cznum>0)
238                 {
239                     if(jjcc==1) outfile<<"+";
240                     else if(jjcc==2) outfile<<"-";
241                     else if(jjcc==3) outfile<<"*";
242                     else if(jjcc==4) outfile<<"/";
243                 }
244
245             }
246             num0++;
247             outfile<<endl<<endl;
248         }
249     }
250     if(strcmp(degree0,"高中")==0)
251     {
252         while(num0<=num)
253         {
254             bool pingfang=rand()%2;
255             bool genhao=rand()%2;
256             bool sincal=rand()%2;
257             bool coscal=rand()%2;
258             bool tancal=rand()%2;
259             while(!(sincal||coscal||tancal))
260             {
261                 sincal=rand()%2;
262                 coscal=rand()%2;
263                 tancal=rand()%2;
264             }
265             int numkh=0;
266             outfile<<num0<<‘.‘;
267             int cznum=rand()%5+1;
268             bool kuohao=rand()%2;
269             bool shoukuohao=0;
270
271             bool pingfangout=rand()%2;
272             bool genhaoout=rand()%2;
273
274             bool pingfanguse=0;
275             bool genhaouse=0;
276
277             bool sinout=rand()%2;
278             bool cosout=rand()%2;
279             bool tanout=rand()%2;
280
281             bool sinuse=0;
282             bool cosuse=0;
283             bool tanuse=0;
284
285             if (cznum<3)
286             {
287                 kuohao=0;
288             }
289             int count0=0;
290             int count1=0;
291             int count=0;
292             int count2=0;
293             int count3=0;
294             int count4=0;
295             int kuohaouse=0;
296             int cznum0=cznum-1;
297             while(cznum--)
298             {
299
300                 bool choose0=rand()%2;
301                 bool choose1=rand()%2;
302                 int temp=rand()%100+1;
303                 int jjcc=rand()%4+1;
304                 if(pingfang&&pingfangout&&!pingfanguse)
305                 {
306                     outfile<<"(";
307                     numkh++;
308                     pingfanguse=1;
309                 }
310
311                 if(genhao&&genhaoout&&!genhaouse)
312                 {
313                     outfile<<"√(";
314                     numkh++;
315                     genhaouse=1;
316                 }
317
318
319                 if(sincal&&sinout&&!sinuse)
320                 {
321                     outfile<<"sin(";
322                     numkh++;
323                     sinuse=1;
324                 }
325                 if(coscal&&cosout&&!cosuse)
326                 {
327                     outfile<<"cos(";
328                     numkh++;
329                     cosuse=1;
330                 }
331                 if(tancal&&tanout&&!tanuse)
332                 {
333                     outfile<<"tan(";
334                     numkh++;
335                     tanuse=1;
336                 }
337
338                 if(cznum==0||cznum==1)
339                 {
340                     if(sincal==1)
341                     {
342                         outfile<<"sin(";
343                         numkh++;
344                         sinuse=1;
345                     }
346                     if(coscal==1)
347                     {
348                         outfile<<"cos(";
349                         numkh++;
350                         cosuse=1;
351                     }
352                     if(tancal==1)
353                     {
354                         outfile<<"tan(";
355                         numkh++;
356                         tanuse=1;
357                     }
358                 }
359
360                 if(kuohao&&cznum>=2&&choose0&&!kuohaouse)
361                 {
362                     outfile<<"(";
363                     numkh++;
364                     kuohaouse=1;
365                     if(cznum0==cznum)
366                     {
367                         shoukuohao=1;
368                     }
369                 }
370                 outfile<<temp;
371
372                 if(sinuse&&cznum==0&&numkh>0)
373                 {
374                     outfile<<")";
375                     numkh--;
376                     sinuse=0;
377                 }
378                 if(sincal&&sinout&&sinuse&&count2>=2&&numkh>0)
379                 {
380                     outfile<<")";
381                     numkh--;
382                     sinuse=0;
383                     count2=0;
384                 }
385                 if(sincal&&sinout&&genhaouse&&count2==1&&numkh>0)
386                 {
387                     outfile<<")";
388                     numkh--;
389                     sinuse=0;
390                 }
391
392                 if(cosuse&&cznum==0&&numkh>0)
393                 {
394                     outfile<<")";
395                     numkh--;
396                     cosuse=0;
397                 }
398                 if(coscal&&cosout&&cosuse&&count3>=2&&numkh>0)
399                 {
400                     outfile<<")";
401                     numkh--;
402                     cosuse=0;
403                     count2=0;
404                 }
405                 if(coscal&&cosout&&genhaouse&&count3==1&&numkh>0)
406                 {
407                     outfile<<")";
408                     numkh--;
409                     cosuse=0;
410                 }
411
412                 if(tanuse&&cznum==0&&numkh>0)
413                 {
414                     outfile<<")";
415                     numkh--;
416                     tanuse=0;
417                 }
418                 if(tancal&&tanout&&tanuse&&count4>=2&&numkh>0)
419                 {
420                     outfile<<")";
421                     numkh--;
422                     tanuse=0;
423                     count2=0;
424                 }
425                 if(tancal&&tanout&&genhaouse&&count4==1&&numkh>0)
426                 {
427                     outfile<<")";
428                     numkh--;
429                     tanuse=0;
430                 }
431
432
433                 if(genhaouse&&cznum==0&&numkh>0)
434                 {
435                     outfile<<")";
436                     numkh--;
437                     genhaouse=0;
438                 }
439                 if(genhao&&genhaoout&&genhaouse&&count1>=2&&numkh>0)
440                 {
441                     outfile<<")";
442                     numkh--;
443                     genhaouse=0;
444                     count1=0;
445                 }
446                 if(genhao&&genhaoout&&genhaouse&&count1==1&&numkh>0)
447                 {
448                     outfile<<")";
449                     numkh--;
450                     genhaouse=0;
451                 }
452
453
454                 if(pingfanguse&&cznum==0&&numkh>0)
455                 {
456                     outfile<<")^2 ";
457                     numkh--;
458                     pingfanguse=0;
459                 }
460                 if(pingfang&&pingfangout&&pingfanguse&&count0>=2&&numkh>0)
461                 {
462                     outfile<<")^2 ";
463                     numkh--;
464                     pingfanguse=0;
465                     count0=0;
466                 }
467                 if(pingfang&&pingfangout&&pingfanguse&&count0==1&&numkh>0)
468                 {
469                     outfile<<")^2 ";
470                     numkh--;
471                     pingfanguse=0;
472                 }
473
474
475                 if(kuohao&&kuohaouse&&choose1&&count>=2&&numkh>0)
476                 {
477                     outfile<<")";
478                     numkh--;
479                     kuohao=0;
480                     kuohaouse=0;
481                 }
482                 if(kuohao&&kuohaouse&&cznum==0&&numkh>0)
483                 {
484                     outfile<<")";
485                     numkh--;
486                     kuohaouse=0;
487                 }
488                 if(shoukuohao&&kuohaouse&&cznum==1&&numkh>0)
489                 {
490                     outfile<<")";
491                     numkh--;
492                     kuohaouse=0;
493                 }
494                 count0++;
495                 count1++;
496                 count++;
497                 count2++;
498                 count3++;
499                 count4++;
500                 while(numkh>0)
501                 {
502                     numkh--;
503                     outfile<<")";
504                 }
505                 if(cznum>0)
506                 {
507                     if(jjcc==1) outfile<<"+";
508                     else if(jjcc==2) outfile<<"-";
509                     else if(jjcc==3) outfile<<"*";
510                     else if(jjcc==4) outfile<<"/";
511                 }
512             }
513             num0++;
514             outfile<<endl<<endl;
515         }
516     }
517 }

如果能将这些相似功能的代码整合成一个模块,多次调用(如+、-、*、/、括号、幂运算的添加)代码量至少能缩短1/3还便于维护

总结

  通过这次结对编程对对方代码的分析,收获良多。和其他人合作,能让你观察到其他人的思考过程。你还可以看到他们写代码的方式。你能学会他们使用的工具。对于很多人来说,找到其他开发者一起合作,是一件奢侈的事情。但是所有人都可以用一种另外的方式学习别人的经验和技巧:仔细研读其他人写的代码。阅读高质量代码,就像是阅读一本好的小说。

原文地址:https://www.cnblogs.com/sorvon/p/11552847.html

时间: 2024-08-30 08:41:01

结对编程个人项目分析的相关文章

结对编程对方项目分析

优点: 1.工程内容超额完成了任务,增加了UI界面,并且把需求给的账号密码和所有运行程序期间生成的题目都保存在了数据库里,完成度更高,也比只是用TXT保存账号内容更具扩展性. 2.程序类划分的很明确,每个类拥有什么方法是用来做什么的一目了然. 3.使用多线程生成题目,响应速度快. 缺点: 1.注释介绍较少,有些地方只看方法名还是不能明了是做什么的. 2.对多态的使用较少,后期修改可能比较麻烦. 3.建UI的时候里面的方法首字母都大写了,命名得不是很规范,其他变量名都还好. 4.数据库是本地数据库

结对编程项目分析

前言. 今天彻底完成了结对编程项目. 从个人项目开始到结对编程结束,过程一直比较坎坷. 个人项目的困难主要集中在出题方面,再详细点还是括号问题,最初的个人项目只能完成括号内括号,不能生成两个独立的括号,这个问题在结对编程开始时,参照搭档的c语言代码,已经得到解决.主要思想是建立两个列表分别记录每个数字左右两边的括号情况. 综述. 因为是第一次真正做一个ui的比较完整的小项目,第一次用python来做ui,一切也基本上是从零开始,从网上找资料学会最基本的之后,越往后就越需要自己一点点摸索. 在开始

结对编程 搭档个人项目分析

看别人的代码,我觉得是一个痛苦又会有所收获的过程,很多和自己的逻辑不相符的算法思路都是皱着眉头硬看下去,但有的完全理解后,转念一想好像又确实没啥毛病,甚至还比自己的思路巧妙了那么一些,拓展了自己下一次在面对同样问题时的解决思路 队友和我自己一样,也是用了c++(虽然和java一样都半斤八两,但毕竟是大一就学的语言总有点亲切的味道?) 先说优点,首先是注释很清楚,清晰的注释无疑让我的阅读体验上升了不少,可以明了地看出算法的思路(缓缓放下了手中的刀.......) int Primary(int n

结对编程:电梯调度

电梯调度项目: 项目分析与需求: 从题目上来看,项目要求编写一个掌控电梯的程序.电梯这个东西,大家都乘过,无非就是:乘客上电梯,判断是否超重,乘客选择想要达到的楼层,最后依次去到离需求最近的一个楼层. 项目中要求有四个电梯,其中第一号和第四号电梯是一模一样的,只需要把负载量给修改即可:第二和第三也大同小异,只需要把负载量和输入楼层的判断方式修改一下即可. 在我们的设想中,我们要达到的效果是这样的:得有一个switch语句,来控制一开始的电梯选择界面:之后在case语句之后相应搭载各种需要的语句以

结对-结对编程项目作业名称-结对项目总结

结对编程项目进度报告 项目名称:电灯游戏 人    员:董馨遥  2015035107077 杨  露  2015035107084 所用时间:2017.09.14 ----2017.10.25 游戏项目分析:有个N行N列的正方形灯板,当你开关其中一盏灯:它和上下左右的灯的状态全部反转,如果被点击的灯不是第一排,则改变上边的灯,如果被点击的灯不是最后一排,则改变下边的灯,如果被点击的灯是最左边,则改变右边的灯,如果被点击的灯适最右边,则改变左边的灯.最后是所有的灯都亮 游戏运行结果:运行代码后,

软件工程网络15专业结对编程

结对编程作业总览 项目成员: 黄俊麟 201521123022 郑子杰 201521123021 项目码云地址: https://gitee.com/paitouzi/pair_programming/tree/master 具体项目分析: 1.需求分析 本次结对编程,我们自己新编写了一个计算器程序,能够实现简单的加减乘除运算. 在结对编程的分工中,我所负责的任务如下: 初始化业务逻辑. 开方.正负.清零.退格.数字内容输入拼接,输出结果的实现. 四则运算算法的实现. 每个按钮返回对应的业务(每

结对编程

结对编程(英语:Pair programming)是一种敏捷软件开发的方法,两个程序员在一个计算机上共同工作.一个人输入代码,而另一个人审查他输入的每一行代码.输入代码的人称作驾驶员,审查代码的人称作观察员(或导航员).两个程序员经常互换角色. 在结对编程中,观察员同时考虑工作的战略性方向,提出改进的意见,或将来可能出现的问题以便处理.这样使得驾驶者可以集中全部注意力在完成当前任务的"战术"方面.观察员当作安全网和指南.结对编程对开发程序有很多好处.比如增加纪律性,写出更好的代码等.

软件工程------结对编程第二次

这一周我(1551426)还是继续和我们组的成员(1551419)两人一起结对编程,除此之外,我们还设计了数据库的,总共三个关系模式 room(roomtype,dailyprice,deposit) roominfo(roomnumber,roomtype,isfree) guest(id, startday,phonenumber,roomnumber,name,sex,stayday) 起初我们把room和guest 放在了一起,后来发现数据的冗余以后马上换成三个关系表. 这是我们的关系图

软工第二次实验——结对编程

1丶小组成员 卫瑞亮 1500802122 王玉卿 1500802099 2.代码链接 https://coding.net/u/qq1062718477/p/SE_task/git/commits/master/ 3.软件界面 4.结对编程照片 5.心得体会 到今天接触结对编程差不多两周了,对于结对编程有了更加深刻地理解,通过结对编程,我们可以及时的发现并解决后面可能会出现的问题,并且还能提升我们与别 人进行交流的能力,与人沟通对我们来说也是极为重要的,同时,结对编程使我们频繁进行交流,而且要