1) You need to work this problem backwards.
x=0 and x=5 and those are the roots so the factoring must have looked something like this:
(x-0)(x-5) Then you would FOIL it:
x^2-5x-0-0 Then simplify:
x^2-5x.
2) Do the same thing with this problem.
x=7 and x=7
(x-7)(x-7)
x^2-7x-7x+49
x^2-14x+49
I hope that this helps.