예제 #1
0
 public AdditionModel()
 {
     System.Random random = new Random();
     for (int i = 0; i <= 15; i++)
     {
         Equation e = new Equation();
         e.Lhs = random.Next(100, 999);
         e.Rhs = random.Next(100, 999);
         _equations.Add(e);
     }
 }
        public SubtractModel GetSubtractEquations()
        {
            SubtractModel subtractModel = new SubtractModel();
            List<Equation> _equations = new List<Equation>();
            System.Random random = new Random();
            for (int i = 0; i <= 20; i++)
            {
                Equation e = new Equation();
                e.Lhs = random.Next(47, 111);
                e.Rhs = random.Next(21, 45);
                if (e.Lhs > e.Rhs)
                {
                    _equations.Add(e);
                }
                else
                {
                    --i;
                }
            }

            subtractModel.Equations = _equations;
            return subtractModel;
        }