Manchester | 26-ITP-Sep | Mathew Shaibu | Sprint 3 | Coursework-Sprint 3 - #1586
MattCarolus10 wants to merge 75 commits into
Conversation
|
Your PR description is incomplete. You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page. Make sure to fill in all fields in the template. Please ensure:
If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
Your PR description is incomplete. You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page. Make sure to fill in all fields in the template. Please ensure:
If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
Your PR description is incomplete. You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page. Make sure to fill in all fields in the template. Please ensure:
If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
1 similar comment
|
Your PR description is incomplete. You filled out a template (that starts "Learners, PR Template") when you created this PR - you can see it at the top of this page. Make sure to fill in all fields in the template. Please ensure:
If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
9e63507 to
9fdc5ce
Compare
…word checker functionality
iscmiguelsamaniego
left a comment
There was a problem hiding this comment.
Fantastic work on this exercise! You've solved the core problem cleanly. Take a look at the question above when you have a moment to think about it. Great job overall!
There was a problem hiding this comment.
Hello! Fantastic job analyzing the error message. You correctly spotted that using let str = ... was trying to re-declare the parameter, causing that SyntaxError. Great problem-solving!
Your solution using str2 works and successfully capitalizes the word. I just have a couple of questions to help us think about code cleanliness:
Look closely at your function body. Since you are already creating the transformed string inside the template literal, could you put the return keyword right in front of it?
If you do that, do you actually need to declare str2 at all?
You are doing amazing. Let me know what you think! 😊
There was a problem hiding this comment.
Hello! Great job working through this exercise. I have a couple of questions to help you think a bit deeper about your code:
What do you expect to see in the console when you execute console.log(convertToPercentage(10.5));?
Thinking about what a decimal number represents mathematically (for example, the 0.5 that originally represented 50%), can you imagine what would happen if we tested 0.5 or 0.75 instead of 10.5? How would the function interpret that value?
You're doing fantastic! Let me know what you think when you have a moment. 😊
There was a problem hiding this comment.
Hello! Great job on this exercise! You accurately predicted the error and gave a brilliant explanation of why a function parameter needs to be a placeholder name like num instead of a fixed value like 3. Your corrected code looks spot on.
Keep up the fantastic work! Let me know if you have any questions about how parameters work under the hood.
There was a problem hiding this comment.
Hello! Great job fixing the function by using return instead of console.log.
Quick question to think about: when combining functions with template strings like this, why is returning the value rather than printing it directly so important?
There was a problem hiding this comment.
Hello! Great job spotting that the code needed the expression to be right next to the return statement. Your corrected code is clean and works perfectly.
Quick question to think about: why does JavaScript automatically insert a semicolon and stop executing right after the return keyword if nothing is on that line?
There was a problem hiding this comment.
Hello! Great job walking through this time-formatting exercise and carefully tracing how pad is called multiple times. Your answers show a strong understanding of how functions interact with each other.
Quick question to think about: when pad runs while (numString.length < 2), what happens if a number already has 2 digits (like 15), and how does the while loop decide whether or not to add a "0" in front of it?
There was a problem hiding this comment.
Hello! Great job writing the calculateBMI function! Using .toFixed(1) is a neat and effective way to format the result to one decimal place.
Quick question to think about: what type of data does the .toFixed() method return in JavaScript (is it a string or a number), and why might that matter if another part of your program expects to perform mathematical operations on the BMI result?
There was a problem hiding this comment.
Hello! Great job implementing the UPPER_SNAKE_CASE function using .toUpperCase() and .replaceAll(). Your test string is very creative!
Quick question to think about: just like we looked at in a previous exercise, do we need to store the transformed string in a new variable before returning it, or could we return the expression directly?
There was a problem hiding this comment.
Hello! Great job wrapping the original snippet into a reusable function and getting it to format the price correctly.
Quick question to think about: look closely at the parameter name you chose (inPounds) and the value you pass into it ("599p"). Does the input represent pounds or pence, and how could choosing a different parameter name make the function's purpose even clearer?
There was a problem hiding this comment.
Hello! Great job tackling this tricky clock-formatting exercise and successfully fixing the bugs for midnight, noon, and minutes.
Quick question to think about: looking at your test for 19:30, your function returns "7:30 pm". Comparing this with how morning hours or earlier tests are formatted (like "02:00 pm"), would it be helpful to include a leading zero for single-digit afternoon hours, and how might you do that?
|
The files changed in this PR don't match what is expected for this task. Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints. Please review the 'files changed' tab at the top of the page. Here is an example of a file that has been changed on this branch but shouldn't be: If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed). If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above. |
Self checklist
Task code
CYF-1053
Changelist
Completed prediction and documented syntax error
Fixed multiple calls to match log statements
Variable declaration
Used upperCase and replaceAll function
This project focused on understanding javaScript fundamentals, catching syntax errors, debugging, scope, and using function to create reusable codes