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 ); } }