We ask all students to put down a $3,000 fully refundable deposit.
There are clearly defined rules for deducting from the deposit (e.g., arrive late for class: $10, etc.). The money deducted does not go to us, but is distributed evenly among the other students.
The reason for the deposit is that students are working in pairs throughout the class, and if a student doesn’t show up, he/she disrupts the classroom experience for everybody. The system was successful for our summer course; it both helps ensure that students have a pair programming partner everyday and that even though the class is free upfront, everyone feels invested.
As long as students show up everyday and stay focused, they get their deposits back at the end, as all of the summer students have.