201944648+自动生成四则运算题第一版报告
1. 需求分析: 生成10道100以内的2个操作数的四则运算算式, 剔除重复算式, 题目数量可控, 相关参数可控, 结果存储到外部文本
2. 功能设计: 分基本功能为加减乘除, 以及扩展功能剔除重复算式等功能.
3. 设计实现: 一个主类作为入口, 设计一个类作为功能的实现类, 类中分为print打印方法, calculate计算方法, 以及获取数值和查重的方法
4. 测试运行:


5.
public int[] add(int num, int si){ int a[]=new int[3]; if (si==1){ a[0]=((int) (Math.random() * num)) * sign[(int) (Math.random() * 2)];} else{ a[0]=((int) (Math.random() * num)); } while(!check(a[0])) { a[1]=add2(num, si); return a; } a[1]=add2(num, si); return a; } public int add2(int num, int si){ int a=0; if (si==1){ a=((int) (Math.random() * num)) * sign[(int) (Math.random() * 2)]; }else { a=((int) (Math.random() * num)); } while(!check2(a)) { a = ((int) (Math.random() * num)) * sign[(int) (Math.random() * 2)]; } return a; }
6. 总结: 通过使用方法来将不同的功能实现在不同的模块中
7.
|
PSP2.1 |
任务内容 |
计划共完成需要的时间(min) |
实际完成需要的时间(min) |
|
Planning |
计划 |
8 |
6 |
|
· Estimate |
· 估计这个任务需要多少时间,并规划大致工作步骤 |
8 |
6 |
|
Development |
开发 |
82 |
88 |
|
·· Analysis |
需求分析 (包括学习新技术) |
6 |
10 |
|
· Design Spec |
· 生成设计文档 |
5 |
6 |
|
· Design Review |
· 设计复审 (和同事审核设计文档) |
4 |
6 |
|
· Coding Standard |
代码规范 (为目前的开发制定合适的规范) |
3 |
3 |
|
· Design |
具体设计 |
10 |
12 |
|
· Coding |
具体编码 |
36 |
21 |
|
· Code Review |
· 代码复审 |
7 |
9 |
|
· Test |
· 测试(自我测试,修改代码,提交修改) |
13 |
21 |
|
Reporting |
报告 |
9 |
6 |
|
·· Test Report |
· 测试报告 |
3 |
2 |
|
· Size Measurement |
计算工作量 |
2 |
1 |
|
· Postmortem & Process Improvement Plan |
· 事后总结 ,并提出过程改进计划 |
3 |
3 |

浙公网安备 33010602011771号