Some of you may have seen the Internet site, codingbat.com or javabat.com. It is a site for students to learn about programming. Students are given short methods to write to solve particular problems, and then the site tests the methods on a few cases. If the method passes all the test cases, a green check is given for feedback. Javabat also allows students to send the results of their work to their computer science teachers. What an easy lab for teachers to create and grade! However, we found that people were posting solutions to the Javabat problems on the Internet, and some students just were searching for solutions from the Internet and were copying them. The way we discovered this was that students were finding strange, not very good, or even wrong, solutions to the problems that somehow made it through the Javabat test cases.
This semester I want to discourage students from using code from the Internet. One reason is that it is cheating - the students are passing off copied work as their own. Another reason is it defeats the whole purpose of the assignment which is for the student to learn how to solve the problem. A third reason is that I believe the majority of the code on the Internet is of extremely poor quality.
There are good reasons to search the Internet for code - to find examples of how to use a particular feature in a language is one example. For this class, anytime you use code from the Internet, I want there to be documentation and citation in your code giving credit to the site you found the code.
Have fun. Ideally, the method you find wouldn't work on all inputs, but somehow they managed to get it past the test cases on the codingbat site. However, it is also OK to find solutions where the authors calculated values they didn't need - used loops that were unnecessary, or in some other way, did something ridiculous.