Which example of dialogue is punctuated correctly?

“Be careful, because the floor is wet,” he warned.
“Be careful, because the floor is wet”, he warned.
“Be careful, because the floor is wet” he warned.
“Be careful, because the floor is wet.” he warned.

Q&A Platform for Education
Platform Explore for Education