English and ESL Instructor
Whenever the speaker of a quotation is identified before a quotation, there must be a comma before the quoted statement:
After receiving his acceptance letter, Jimmy exclaimed, "It's official! I'm entering the army!"
Also notice that it's is capitalized because it is the beginning word of the quotation.
If the speaker is identified after the quotation, the quotation needs to have a comma before the closing quotation marks:
"I don't understand this problem," said Karen.
Notice that said, the first word following the quotation, is not capitalized.
However, if the quoted statement ends in a question or exclamation mark, then no comma is needed:
"Did anybody see my phone lying around?" asked Ivan.
"You did it! That was a well-deserved win!" said Mike to Jenny.
Again, the first word after the quoted statement is not in capitals (of course, unless it is a proper noun).