If you're willing to put up some effort to learn the command line, try GCC. It will be installed along with XCode if you follow the directions mentioned by one of the above posters. You can then use any text editor you'd like, my preference is TextWrangler. If you're going to follow up this class with more programming classes command line knowledge will give you an advantage.