Solving a word problem using a quadratic equation with rational roots