Swearing has become commonplace in our society, largely due to TV and the movies (not to mention bumper stickers). Children in grade school today hear bad language that used to be reserved for high school. But that doesn't mean you have to listen to it.
Have a rule that "swearing is not allowed in our house." Tell your child not to swear around teachers and other adults. Enforcing what your child says outside the home is more complicated. Back up the school and their rules about swearing. Then accept the fact that how your child talks with his friends in private is something you can't control.
Praise your child for not swearing when he got mad.
Express anger without swearing. You won't be able to get your child to give up any four-letter words that you continue to use. Have you tried "darn it" lately?