In introductory computer programming courses, students experience a range of emotions. Students often experience anxiety and frustration when they encounter difficulties in writing programs. Continued frustration can discourage students from pursuing engineering and computing careers. Although prior research has shown how emotions affect students’ motivation and learning, little is known about students’ emotions in programming courses. In this qualitative study of first-year engineering students taking an introductory programming course, we examined the emotions that these students experienced during programming tasks, and the reasons for experiencing those emotions. Our study was grounded in the control-value theory of achievement emotions. Each research participant came to two laboratory sessions: a programming session and a retrospective think-aloud interview session. In the programming session, each participant worked individually on programming problems. We collected screen capture, biometrics, and survey responses. In the interview session, each participant watched a video of their actions during the programming session. After every two minutes of viewing, the participants reported the emotions that they had experienced during this two-minute period. We performed a thematic analysis of the interview data. Our results indicate that the participants experienced frustration most frequently. Sometimes they experienced multiple emotions. For example, one participant felt annoyed because she had made a mistake, but she felt joy and pride when she fixed the mistake. To promote student learning, educators should take students’ emotions into account in the design of curriculum and pedagogy for introductory programming courses.