In general, affect functions in a sentence as a verb. The meaning for which it is used are:
1. To influence, to act on, to modify, to pertain to: “The rain will affect our plans for a picnic.”
2. To pretend, to feign: “She is from New Delhi, but she just had to affect a New York accent.”
The one use of affect as a noun is as follows: A feeling, an emotion: “The affect of her speech was to cause anger and great dissension.”
In general, effect functions in a sentence as a noun.
1. A result, a change; usually; a consequence: “The miners felt the effect of the bad working conditions on their bodies for years.”
2. Actuality, fact, reality: “In effect, her comment ended any chances of reconciliation.”
3. Influence, power, force: “The plea for clemency had no effect on the President and she ordered that Kasab be hanged.”
The one of effect as verb is as follows: to produce, to accomplish, to bring about: “Do you think a new dressing style will effect a change in my fortunes?”
Usage example that uses both these words: The affect of the swinging ball did not effect his hitting a six.