Solving quadratic equations by factoring word problems