If you copy multiple programs or whole homework from some online resource, or
from your friend, or from your tutors, 100%, word-to-word, this is undoubtedly
cheating. Substantial plagiarism or complete plagiarism is a major offense
to the academic integrity.
However, if you have just a few lines of code, or a small portion of a solution, inspired or borrowed from your friend, from your family, or from your tutors, or from online, or from any other resources, this may or may not be cheating dependent on how well you understand what you have written down. So this is a gray area -- Students suspected of this kind of minor offense may be given a second chance to explain how they did the code or understood the concept they used.