protected override Question GenerateQuestion() { double a = 0; double b = 0; double c = 0; MathAPI.MMSelectRandom(ref a, ref b, ref c, this.maxNumber, this.maxNumber, 0); Operator op = Operator.Multiply; Random key = new Random(); Random rand = new Random(4 * key.Next()); int randOpIndex = rand.Next(); randOpIndex = randOpIndex % 2; if (randOpIndex == 0) { op = Operator.Multiply; } else { op = Operator.Division; double temp = a; a = c; c = temp; } return(new Question_a_b_c((int)a, (int)b, (int)c, op)); }
private Question GenerateMD() { double a = 0; double b = 0; double c = 0; MathAPI.MMSelectRandom(ref a, ref b, ref c, this.maxNumber, this.maxNumber, 0); Operator op = Operator.Multiply; Random key = new Random(DateTime.Now.Second); Random rand = new Random(DateTime.Now.Second * key.Next(1234)); int randOpIndex = rand.Next(99); randOpIndex = randOpIndex % 2; if (randOpIndex == 0) { op = Operator.Multiply; } else { op = Operator.Division; double temp = a; a = c; c = temp; } return(new Question_a_b_c((int)a, (int)b, (int)c, op)); }
protected override Question GenerateQuestion() { double a = 0; double b = 0; double c = 0; MathAPI.MMSelectRandom(ref a, ref b, ref c, 9, 9, 0); Operator op = Operator.Multiply; return(new Question_a_b_c((int)a, (int)b, (int)c, op)); }
protected override Question GenerateQuestion() { int a = 0; int b = 0; int c = 0; MathAPI.MCSelectRandom(ref a, ref b, ref c, this.maxNumber, 0); Operator op = Operator.Plus; if (a - b == c) { op = Operator.Minus; } return(new Question_a_b_c(a, b, c, op)); }