For how to do APA 7th referencing in general please see the ECU Referencing guide.
The following are some suggested examples not covered by the guide. These are adaptions of the rules of APA 7th and are only suggestions on how to include all the relevant information for the referencing. Please check with your lecturer or tutor on how they prefer you to show your references first.
If you have to reuse or showcase any code that you have sourced from somewhere else (so something that you did not write yourself) you need to reference the code.
Please check with your lecturer before reusing code. The following is a guide on how to reference code but it should be used sparingly. Check with your lecturer and assignment instructions on how they prefer you reference code or what you should reference. They may have a distinction between guides and someone else's work.
Referencing code inside an assignment is the same as referencing an image or quotation.
If you have screenshotted code reference it like an image: See our Figures, Tables, & Images guide
Reference this like a quotation: See our section on Direct Quotations
... it is a good test for evaluating whether or not candidates can identify logical hierarchy when writing looping statements. If the following statement isn't included in the first logic test the game will not work:
if fizzbuzz % 3 == 0 and fizzbuzz % 5 == 0;
print("fizzbuzz");
(W3resource, 2021)
Include a citation below the snippet similar to a block quote no matter how many words/characters you have.
Adapted from Massachusetts Institute of Technology, (n.d.) Writing Code. https://integrity.mit.edu/handbook/writing-code
If you have to reuse or showcase any code that you have sourced from somewhere else (so something that you did not write yourself) you need to reference the code.
Please check with your lecturer before reusing code. The following is a guide on how to reference code but it should be used sparingly. Check with your lecturer and assignment instructions on how they prefer you reference code or what you should reference. They may have a distinction between guides and someone else's work.
If you need to reuse or work with some code you have taken from another source you must give credit in the code. This includes adapting parts of the structure or even using the structure with your own variables in it. If you have created it based on documentation, unit materials or guides, textbook examples, or other supporting documentation found online then check with your lecturer to see what they prefer you to do with referencing, or if they would prefer something simpler than the example below.
The following example is only a suggestion. Please provide credit such that the original source can be identified.
Use comments before the function to include all the details about where the function came from. Include all the basic elements of an end-text reference (lines 2-6 in the image above).
Things to include:
Disclaimer: this function is only copied as an example. Please don't use a whole function unless explicitly instructed to.
Adapted from Massachusetts Institute of Technology, (n.d.) Writing Code. https://integrity.mit.edu/handbook/writing-code
Edith Cowan University acknowledges and respects the Noongar people, who are
the traditional custodians of the land upon which its campuses stand and its programs
operate.
In particular ECU pays its respects to the Elders, past and present, of the Noongar
people, and embrace their culture, wisdom and knowledge.