Name: Tiffany Jiang
Date: 8/22/2023
I received assistance from: NO ONE
I assisted: NO ONE
It is impossible to edit variables who have been set using the "let" term.
When you set x as y in line 4, they are then the same number, and the number that x originally represented would no longer exist. Thus, when you set y as x in line 5, nothing changes.
It will gain the value of y.
It will not change
A third variable (for example, z) must be created to temporarily hold the integar of the first variable that swaps (x), and then you must swap the other variable (y) with to the integar that z z represents.
It will not compile correctly because the function is changing a variable that has been set outside of the function, and it will protect against that.
"inout" is added to the function declaration line right before the declaration that the variable "n" is an Integar. When calling the function, an ampersand sign is also added right before "x".
Looking at the inout part of the function was kind of confusing.
I think it was pretty clear.
I learned about the inout part of the function and the ampersand we needed to add if we wanted to edit variables that we use in the function.
There are more methods that I need to learn from swift that are useful.