Finitely presented and residually finite implies solvable word problem