211606369 蔺皓雯 211606349 蔡晨旸
PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
Planning | 计划 | 600 | 760 |
? Estimate | ? 估计这个任务需要多少时间 | 600 | 760 |
Development | 开发 | ||
? Analysis | ? 需求分析 (包括学习新技术) | 60 | 50 |
? Design Spec | ? 生成设计文档 | 30 | 30 |
? Design Review | ? 设计复审 | 20 | 10 |
? Coding Standard | ? 代码规范 (为目前的开发制定合适的规范) | 30 | 20 |
? Design | ? 具体设计 | 20 | 20 |
? Coding | ? 具体编码 | 300 | 360 |
? Code Review | ? 代码复审 | 60 | 60 |
? Test | ? 测试(自我测试,修改代码,提交修改) | 120 | |
Reporting | 报告 | 20 | 30 |
? Test Repor | ? 测试报告 | 20 | 30 |
? Size Measurement | ? 计算工作量 | 10 | 10 |
? Postmortem & Process Improvement Plan | ? 事后总结, 并提出过程改进计划 | 20 | |
合计 | 760 |
我通过上网查阅的方式了解到,小学三数学有如下的几个特点:
经过分析,我认为,这个程序应当:
输出题目和结果
关键函数的流程图
导致计算结果出现了问题,目前正在不断优化中
String c[] ={"+","-","×","÷"};
byte contentInBytes[];
Random rand=new Random();
for (int i=0;i<=n;i++) {
int a=rand.nextInt(c.length);
String resultChar=c[a];//运算符号存入resultChar
if (grade==1) {
for (int i1=0;i1<=n;i1++) {
left=rand.nextInt(100);
right=rand.nextInt(100);//左右百内随机数
String b= left+resultChar+right+"=";//题目
//又一套,存题目
if(resultChar=="+"){
re3=left+right;
String d=left+resultChar+right+"="+re3;
}else if(resultChar=="-"){
re3=left-right;
String e=left+resultChar+right+"="+re3;
}
}
}
if (grade==2) {
for (int i2=0;i2<=n;i2++) {
if(resultChar=="+"){
left=rand.nextInt(10000);
right=rand.nextInt(10000);
String b= left+resultChar+right+"=";
if((left%100==0 || left%1000==0 || left<=100)&&(right%100==0 || right%1000==0 || right<=100)) {
re3=left+right;
String e=left+resultChar+right+"="+re3;
}
if(left%100==0 && left>=100 && (right%100==0 || right%10==0)) {
re3=left+right;
String f=left+resultChar+right+"="+re3;
}
}else if(resultChar=="-"){
left=rand.nextInt(10000);
right=rand.nextInt(10000);
String b= left+resultChar+right+"=";
if((left%100==0 || left%1000==0 || left<=100)&&(right%100==0 || right%1000==0 || right<=100)) {
re3=left-right;
String g=left+resultChar+right+"="+re3;
}
if(left%100==0 && left>=100 && (right%100==0 || right%10==0)) {
re3=left-right;
String h=left+resultChar+right+"="+re3;
}
}else if(resultChar=="×"){
left=rand.nextInt(10)+1;
right=rand.nextInt(10)+1;
String b= left+resultChar+right+"=";
re3=left-right;
String j=left+resultChar+right+"="+re3;
}else if(resultChar=="÷"){
left=rand.nextInt(10)+1;
right=rand.nextInt(10)+1;
String b= left+resultChar+right+"=";
re2=left/right;
re1=left%right;
String k=left+resultChar+right+"=";
if(re1==0) {
re3=left/right;
String l=left+resultChar+right+"="+re3;
}
else {
String m=left+resultChar+right+"="+(re1+"..."+re2);
}
}
}
}
if (grade==3) {
for (int i3=0;i3<=n;i3++) {
if(resultChar=="+"){
left=rand.nextInt(10000);
right=rand.nextInt(10000);
re3=left+right;
String o= left+resultChar+right+"="+re3;
}
if(resultChar=="-") {
left=rand.nextInt(10000);
right=rand.nextInt(10000);
re3=left-right;
String o= left+resultChar+right+"="+re3;
}
if(resultChar=="×") {
left=rand.nextInt(1000)+100;
right=rand.nextInt(100)+10;
re3=left*right;
String o= left+resultChar+right+"="+re3;
}
if(resultChar=="÷") {
left=rand.nextInt(1000)+100;
right=rand.nextInt(100)+10;
re3=left/right;
String o= left+resultChar+right+"="+re3;
re2=left/right;
re1=left%right;
if(re1==0) {
String p=left+resultChar+right+"="+re3;
}
else {
String p=left+resultChar+right+"="+(re1+"..."+re2);
}
因为
请给出本次实验使用的代码规范:
测试例 | 结果 |
---|---|
6 2 | 题目答案已生成请查看out.txt 正确 |
10000 3 | 参数过大 |
5 3 | 题目答案已生成请查看out.txt 正确 |
原文:https://www.cnblogs.com/hwlc--/p/9657384.html