自动生成100以内两个操作数的四则运算供小学生做计算练习
基本功能:自动生成10道100以内的2个操作数的四则运算算式(+ - * /),要求运算结果也在100以内;
扩展功能:(1)剔除重复算式。2 + 3 = 和 2 + 3 = 是重复算式 2 + 3 = 和3 + 2 = 不属于重复算式;
(2)题目数量可定制;
(3)相关参数可控制;
是否包含乘法和除法;
操作数数值范围可控;
操作数是否含负数;
使用Java语言实现以上功能和需求
static void printA(HashSet<String> hashSet) throws IOException {
PrintWriter cs = new PrintWriter( new FileWriter( "D:\\许爽.txt" ) );//生成无答案文件
PrintWriter csc = new PrintWriter(new FileWriter("D:\\result.txt"));//生成有答案文件
sum = 1;
int sum1 = 1;
for (Iterator i = hashSet.iterator(); i.hasNext();) {
cs.println(i.next());
sum++;
}
cs.close();
for(Iterator it = hashSet.iterator();it.hasNext();){
String next = (String) it.next();
String[] split = next.split("= ");
csc.println(split[0] + "=");
sum1++;
}
写代码使用的语句比较简单,没有高级感,只能实现一些简单的功能,所以以后上课要认真听讲,熟记老师上课讲的重点。
PSP2.1 | 任务内容 | 计划共完成需要的时间(min) | 实际完成需要的时间(min) |
---|---|---|---|
Planning | 计划 | 10 | 10 |
Estimate | 估计这个任务需要多少时间,并规划大致工作步骤 | 10 | 10 |
Development | 开发 | 180 | 240 |
Analysis | 需求分析 (包括学习新技术) | 20 | 25 |
Design Spec | 生成设计文档 | 20 | 20 |
Design Review | 设计复审 (和同事审核设计文档) | 10 | 20 |
Coding Standard | 代码规范 (为目前的开发制定合适的规范) | 10 | 10 |
Design | 具体设计 | 25 | 35 |
Coding | 具体编码 | 40 | 80 |
Code Review | 代码复审 | 30 | 25 |
Test | 测试(自我测试,修改代码,提交修改) | 25 | 25 |
Reporting | 报告 | 75 | 75 |
Test Report | 测试报告 | 20 | 20 |
Size Measurement | 计算工作量 | 25 | 25 |
Postmortem & Process Improvement Plan | 事后总结 ,并提出过程改进计划 | 30 | 30 |
原文:https://www.cnblogs.com/shushuang/p/11530273.html