London | 26-ITP-Jan | Carlos Abreu | Sprint 1 | Coursework#1146
London | 26-ITP-Jan | Carlos Abreu | Sprint 1 | Coursework#1146carlosyabreu wants to merge 19 commits intoCodeYourFuture:mainfrom
Conversation
cjyuan
left a comment
There was a problem hiding this comment.
Very detailed explanations and well formatted code.
I only have some questions to challenge your understanding and some suggestions.
| /* The line 3 is increasing the variable count by 1 and assigning the result to count variable on the left hand * side. | ||
| */ |
There was a problem hiding this comment.
Operation like count = count + 1 is very common in programming, and there is a programming term describing such operation.
Can you find out what one-word programming term describes the operation on line 3?
There was a problem hiding this comment.
Evening @cjyuan
Absolutely sure.
The operator = is called the assignment operator.
On the right hand side of =, the expression count + 1 is evaluated first.
Since count currently has the value 0, count + 1 results in 1.
Then the result 1 is assigned to the variable count on the left hand side of the operator =.
At this stage the value stored in count becomes 1.
To wrap up the line 3 does is to take the current value of count, add 1 to it, and store the result back into count.
There was a problem hiding this comment.
I was asking for the programming term for operation like "count = count + 1" or "count++".
|
@JaypeeLan Sorry I didn't add the "Review in progress" label when I started reviewing this PR. |
|
Hi @cjyuan After answering your queries in comment box I clicked the button 'resolution' or something similar. |
|
Sorry @cjyuan after a few minutes the bot run showing 'All checks have passed' message. |
|
All good. |
Learners, PR Template
Self checklist
Changelist
PR for Sprint 1 of Structuring and Testing Data