Professor wants to use required class project for research In one of my required undergraduate courses, my professor has given a mandatory assignment. He has indicated that he will use our code from the assignment for his research. He has not mentioned attributing it, nor asked our permission to use the code.

I'm not opposed to him using the code for his research, but I want to guarantee that if he does, I will be attributed. Is there a good way to go about this? Furthermore, is it acceptable for a professor to use student code from required class projects for research?

(there was a similar question here but did not apply, since it dealt with commercial uses, and another here but did not include the fact that the course was required for the major.)
There may be course policies or institution policies allowing it at your school, but you should be at least cited/credited/acknowledged in that professor's research. 

I've personally had my research and work used in a professors publications and she has always at least acknowledged me in her publications. 

(My case may differ from yours, in that the research I was involved in was done on a student-employee basis. I'm not sure how that might change the dynamic.)

I would certainly at least send an email so that there is some sort of recoverable proof, asking if your work will be cited/attributed to yourself. Don't fall victim to the old "your reward is the experience" thing. While valid and applicable in some situations, not so when it's your intellectual property.