标签:pre exception 并且 exce img ble 分析 搜索 命名
Pair_211606349蔡晨旸_211606369蔺皓雯
PSP2.1 | Personal Software Process Stages | 预估耗时(分钟) | 实际耗时(分钟) |
---|---|---|---|
Planning | 计划 | 2h | 3h |
? Estimate | ? 估计这个任务需要多少时间 | 3d | 2.5d |
Development | 开发 | 2d | 2d |
? Analysis | ? 需求分析 (包括学习新技术) | 1d | 0.5d |
? Design Spec | ? 生成设计文档 | 3h | 1.5h |
? Design Review | ? 设计复审 | 1.5h | 1h |
? Coding Standard | ? 代码规范 (为目前的开发制定合适的规范) | 1h | 1h |
? Design | ? 具体设计 | 3h | 3h |
? Coding | ? 具体编码 | 2d | 2d |
? Code Review | ? 代码复审 | 2h | 1h |
? Test | ? 测试(自我测试,修改代码,提交修改) | 2h | 1h |
Reporting | 报告 | 0.5h | 1h |
? Test Repor | ? 测试报告 | 2h | 0.5h |
? Size Measurement | ? 计算工作量 | 0.5h | 0.5h |
? Postmortem & Process Improvement Plan | ? 事后总结, 并提出过程改进计划 | 2h | 1h |
合计 3d | 3d |
经过分析,我认为,这个程序应当:
对三年级来说,数字在100至999之间,乘除法题。被乘数与被除数为两位数。
- 加减法题没有什么限制。
说明你如何设计这个程序
比如:
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);
}
请给出本次实验使用的代码规范:
非公有(private/protected/default)变量前面要加上小写m;
静态变量(static)前面加上小写s;
其它变量以小写字母开头;
静态常量(static final)全大写。
并人工检查代码是否符合规范
|输入测试数据3 1|输出成功并且结果正确 |输出成功,加减法答案正确 |
|输入测试数据3 2|输出成功并且结果正确 |输出成功,但答案都不正确|
|输入测试数据3 3|输出成功并且结果正确 |输出成功,加减乘除答案都正确,但是除数不显示余数|
标签:pre exception 并且 exce img ble 分析 搜索 命名
原文地址:https://www.cnblogs.com/yang1998/p/9672173.html