-
-
Notifications
You must be signed in to change notification settings - Fork 239
London | 25-ITP-Sep | KME Blair | Sprint 1 | Coursework #828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| // The = operator is used to assign the new count variable as the original count + 1. | ||
| // testing commit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
|
|
||
| let initials = ``; | ||
| let initials = firstName.slice(0, 1)+middleName.slice(0, 1)+lastName.slice(0, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a shorter syntax to refer to the first character in a string.
|
|
||
| console.log(num); | ||
|
|
||
| //Math.random generates a decimal number between 0 and 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phrases like "a number between X and Y" are not precise enough in a program specification, because they do not clearly state whether the endpoints X and Y are included.
We can use the concise and precise interval notation to describe a range of values.
[,]=> inclusion(,)=> exclusion
If we want to denote "x in the range 1 < x <= 100", we can say x is in the interval (1, 100].
Can you use this notation to describe the returned value of Math.random()?
| // so total 5 function calls | ||
|
|
||
| // b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem? | ||
| // error is in line 5, because of a missing , in replaceAll("," ""), which I will add to fix the problem. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the function call .replaceAll(",", ""), there's a programming term for "," and "" (the values passed into the function).
Could you find out what they are called so that you can more precisely indicate where the , is missing.
Learners, PR Template
Self checklist
Changelist
Completed all the coursework exercises in Sprint 1 of Module Structuring and Testing Data
Questions
no questions atm