London | 26-ITP-May | Talia Kucuk | Sprint 1 | Coursework - #1513
London | 26-ITP-May | Talia Kucuk | Sprint 1 | Coursework#1513TaliaKucuk wants to merge 15 commits into
Conversation
| // Try breaking down the expression and using documentation to explain what it means | ||
| // It will help to think about the order in which expressions are evaluated | ||
| // Try logging the value of num and running the program several times to build an idea of what the program is doing | ||
| // num generates a random number between 1 and 100 No newline at end of file |
There was a problem hiding this comment.
Your answer is correct, but can you explain how the expression generates a number between 1 and 100?
Try breaking the line down step by step and describe what each part does.
There was a problem hiding this comment.
Hi, thank you for all your comments. I've now added a more detailed breakdown
| @@ -1,9 +1,7 @@ | |||
| const cardNumber = 4533787178994213; | |||
| const cardNumber = "4533787178994213"; | |||
There was a problem hiding this comment.
Suppose you're not allowed to modify the original value. How would you achieve this using code alone?
There was a problem hiding this comment.
Hi, I've now changed this so that the original code is not modified. Thank you
|
|
||
| // lines 1, 2, 7 and 8 are variable declarations | ||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| // This expression is replacing the , in '10,000' with nothing - essentially removing it No newline at end of file |
There was a problem hiding this comment.
please review the whole code snippet again, and mention whats the purpose of removing the ","
There was a problem hiding this comment.
I've added info regarding the purpose of removing the ","
|
|
||
| // To begin, we can start with | ||
| // 1. const penceString = "399p": initialises a string variable with the value "399p" | ||
| // 3-6. removes the p from "399p" |
There was a problem hiding this comment.
Can you add more detail about the purpose of each operation rather than just the result? The exercise is looking for a step-by-step explanation of how the code works.
There was a problem hiding this comment.
I've added information about the purpose of each operation rather than just the result. Thank you for taking the time to review my work, much appreciated.
|
Closing PR because the May ITP run has finished. Feel free to re-open if you're still working on it. |
Self checklist
Changelist
Submission for Coursework Sprint 1