How can I, as the grader, tell whether this is a program they wrote or copied from someone else. The only means of detection available to me are the blatant case where multiple people hand in the exact same program, or if I recognize a particular solution from somewhere. Another hint can be that the work is way above the student's usual level (which is not an immediate indication of cheating, but does warrant further investigation).
This isn't hypothetical, by the way. I have graded papers, programming assignments and exams during my time as a Student Assistant at Leiden University.
That's why we always had demonestration session before grading on FYP. The students in the group tell the lecturer which part did they contributed in, and the lecturer ask key questions that "people who done that part should know". If the student don't know the answer, either he/she explain what "other method" they used to achieve that result, or cheating is assumed.