Sharing code for a computer program is only appropriate when your instructor has explicitly permitted collaborative work.
If you are required to write code for a project, the code must be your own work. Do not borrow code or the solution from another student or source.

Graphic by Sara LeBlanc
Next: Splitting the work