结对编程1
结对编程1 四则运算
201421122089 曾瑞
201421122075 郭晓迪
需求分析:
代码展示
中英文对比
char * edaanpanduan(char daan[],char * shuru,char * timu)
{
static char panduanjieguo[30];
FILE * in ,* out,* cuoti;
in=fopen("leijitimushu.txt","r");
fscanf(in,"%d,%d",&eright,&ewrong);
fclose(in);
if(strcmp(shuru,edaan)==0)
{
strcpy(panduanjieguo,"Right!");
eright++;
}
else
{
strcpy(panduanjieguo,"wrong!");
strcat(panduanjieguo,"Answer is:");
strcat(panduanjieguo,edaan);
ewrong++;
cuoti=fopen("cuotiji.txt","a");
fprintf(cuoti,"%s=%s wrong!Right answer is %s\n",timu,shuru,edaan);
fclose(cuoti);
}
out=fopen("leijitimushu.txt","w");
fprintf(out,"%d,%d",eright,ewrong);
fclose(out);
return panduanjieguo;
}
{
static char panduanjieguo[30];
FILE * in ,* out,* cuoti;
in=fopen("leijitimushu.txt","r");
fscanf(in,"%d,%d",&eright,&ewrong);
fclose(in);
if(strcmp(shuru,edaan)==0)
{
strcpy(panduanjieguo,"Right!");
eright++;
}
else
{
strcpy(panduanjieguo,"wrong!");
strcat(panduanjieguo,"Answer is:");
strcat(panduanjieguo,edaan);
ewrong++;
cuoti=fopen("cuotiji.txt","a");
fprintf(cuoti,"%s=%s wrong!Right answer is %s\n",timu,shuru,edaan);
fclose(cuoti);
}
out=fopen("leijitimushu.txt","w");
fprintf(out,"%d,%d",eright,ewrong);
fclose(out);
return panduanjieguo;
}
char * daanpanduan(char daan[],char * shuru,char *timu)
{
static char panduanjieguo[20];
FILE * in ,* out,* cuoti;
in=fopen("leijitimushu.txt","r");
fscanf(in,"%d,%d",&right,&wrong);
fclose(in);
if(strcmp(shuru,daan)==0)
{
strcpy(panduanjieguo,"回答正确!!!!");
right++;
}
else
{
strcpy(panduanjieguo,"错误!");
strcat(panduanjieguo,"正确答案为:");
strcat(panduanjieguo,daan);
wrong++;
cuoti=fopen("cuotiji.txt","a");
fprintf(cuoti,"%s=%s 错误!正确答案为%s\n",timu,shuru,daan);
fclose(cuoti);
}
out=fopen("leijitimushu.txt","w");
fprintf(out,"%d,%d",right,wrong);
fclose(out);
return panduanjieguo;
}
程序运行
小结感受
养成总结与反思的习惯,并有意识地提炼日常工作成果。加强团队合作,结对编程可以促进思维发散形成1+1>2的效果。
评价伙伴
略略略……
PSP.
PSP2.1 | Personal Software Process Stages | Time Senior Student | Time |
Planning |
计划 |
90 | 120 |
Estimate |
估计做这个任务花的时间 |
600 | 480 |
Development | 开发 | 420 | 420 |
Analysis | 需求分析(包括学习新东西) | 30 | 20 |
Design Spec | 生成设计文档 | 30 | 30 |
Design Review | 设计复审 | 10 | 10 |
Coding Standard | 代码规范 | 10 | 10 |
Design | 具体设计 | 60 | 50 |
Coding | 具体编码 | 360 | 360 |
Code Review | 代码复审 | 10 | 12 |
Test | 测试 | 30 | 36 |
Reporting | 报告 | 10 | 10 |
测试报告 | 20 | 20 | |
计算工作量 | 10 | 5 | |
提出改进计划 | 10 | 10 |