PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
Planning | 计划 | 20 | 30 |
? Estimate | ? 估计这个任务需要多少时间 | 240 | |
Development | 开发 | 120 | 240 |
? Analysis | ? 需求分析 (包括学习新技术) | 60 | 60 |
? Design Spec | ? 生成设计文档 | 60 | 60 |
? Design Review | ? 设计复审 | 10 | 10 |
? Coding Standard | ? 代码规范 (为目前的开发制定合适的规范) | 10 | 10 |
? Design | ? 具体设计 | 20 | 20 |
? Coding | ? 具体编码 | 60 | 120 |
? Code Review | ? 代码复审 | 40 | 60 |
? Test | ? 测试(自我测试,修改代码,提交修改) | 15 | 20 |
Reporting | 报告 | 60 | 80 |
? Test Repor | ? 测试报告 | 20 | 20 |
? Size Measurement | ? 计算工作量 | 10 | 10 |
? Postmortem & Process Improvement Plan | ? 事后总结, 并提出过程改进计划 | 20 | 20 |
合计 | 760 |
我通过上网查询的方式了解到,小学一年级数学有如下的几个特点:
经过分析,我认为,这个程序应当:
对于小学二年纪的学生来说,乘除法还比较局限于乘法口诀表,所以乘法方面最好不要出现两位数乘以两位数,有可能出现超纲的情况。
第一个代码中设置一个值,从而可以判断加法还是减法,循环输出随机的题目。
try {
System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("out.txt")), true));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
这一段代码是上学期Java高级开发学会的
public class MathExam2{
static int n;
static int grade;
public static boolean test(String A, String B) {
grade=Integer.parseInt(B);
n=Integer.parseInt(A);
if(n>100) {
System.out.println("输入的题数过多,请输入100以下的数字");
return false;
}
return true;
}
public static void main(String[] args) {
Random ran = new Random();
int a;
if(test(args[0], args[1])) {
String[] question = new String[n+1];
String[] answer = new String[n+1];
File file = new File ("out.txt");
try {
System.setOut(new PrintStream(new BufferedOutputStream(new FileOutputStream("out.txt")), true));
} catch (FileNotFoundException e) {
e.printStackTrace();
}
这段代码实现了实参和形参的传递,将问题和答案保存在String字符串中,方便输出。同时防止输入的题数过多,造成不必要的浪费。
命名不可使用拼音,严格使用英文,方便阅读者的阅读
第一组:10 2
输出结果:输出了10道加减乘除的题目
第二组:200 1
输出结果:输入的题数过多,请输入100以下的数字
第三组: 37 1
输出结果:输出了37道加减的题目
本次代码的难度不算太难,只要想清楚其中的逻辑结构即可,但是题目中的错误处理确实是生活中会出现的问题,比如输入了过多的题数,或者输入了不是数字,则会使程序崩溃。所以在编程前一定要写好需求,在编程的过程中要随手记下出现的问题,及时解决,帮助文档是个好帮手,不懂的问题要及时去查。
原文:https://www.cnblogs.com/L960416/p/9631011.html