Affect is a verb. Effect is a noun. Therefore, affected is correct in this sentence.
Nope, "effect" is also a verb meaning "to bring about." Therefore, "effected" is the correct word for that sentence. Just FYI.