You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
645 B
25 lines
645 B
package mathlearning.service.QuestionGenerator;
|
|
|
|
public class highGenerator extends QuestionGenerator{
|
|
|
|
public highGenerator() {
|
|
super("高中");
|
|
}
|
|
|
|
@Override
|
|
public String generateQuestion() {
|
|
int operandCount = random.nextInt(4) + 2;
|
|
|
|
// 生成操作数
|
|
int[] operands = new int[ operandCount ];
|
|
for (int i = 0; i < operandCount; i++) {
|
|
operands[i] = random.nextInt(100) + 1; // 1-100
|
|
}
|
|
|
|
String question = preForOper( operands );
|
|
question = add_squs( question );
|
|
question = add_sins( question );
|
|
return addParen( question );
|
|
}
|
|
}
|