-
-
Notifications
You must be signed in to change notification settings - Fork 154
Sprint 2 #146
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?
Sprint 2 #146
Conversation
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.
Hi there @Della-Bella
Oh, I think we already hit this problem on another PR. This is still quite mixed up, so please ask to pair with someone to go through opening a PR, branching, and checking what it is actually in your commit before you push it. You'll get it, don't worry!
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.
Thanks for your hard work here, @Della-Bella .
I think it would be a good idea to spend a bit more time on this. There are some foundational concepts that you need to work on here. Book some time in with me or with another volunteer in the pair programming channel and we can walk through this coursework step by step.
You can do this. You will get there.
|
||
DEBUG*/ | ||
|
||
//The result of multiplying 10 and 32 is 320 |
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.
Did this prediction bear out, or did it print undefined? Why did it do this?
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.
The function wasn't called initially, so it didn't display the result. However, it has now been called and is returning the result.
Sprint-2/debug/1.js
Outdated
//FIX:// | ||
|
||
function sum(a, b) { | ||
return; a + b; |
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.
When you executed this function, did this fix work? 🤔
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.
This fix didn't work because the sum of "a" and "b" wasn't included. Now I have fixed the code, and it is returning the result.
// This program should tell the user the last digit of each number. | ||
// Explain why getLastDigit is not working properly - correct the problem | ||
/* This program should tell the user the last digit of each number. | ||
the function doesn’t have a parameter to receive the num variable it’s trying to process. |
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.
This is true, but not complete. It doesn't have a parameter, so why is it returning 3? Where does the 3 come from?
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.
The function was using the same variable every time. Adding a parameter to the function fixed it.T
@@ -3,11 +3,14 @@ | |||
// Why will an error occur when this program runs? | |||
// Try playing computer with the example to work out what is going on |
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.
What do you think? Why is this happening? What is the fix?
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.
Remove the duplicated declaration. With this commit
Sprint-2/errors/2.js
Outdated
|
||
|
||
/* this function should square any number but instead we're going to get an error | ||
Fix 3 is not valid parameter name. should change function name to square(num) |
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.
What is the error, specifically?
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.
The error was with parameter 3, which always gave me the same result. By changing it to "num," the function now works with any number. Also 3 is used as the parameter name for the function, which is not valid in JavaScript.
Sprint-2/implement/bmi.js
Outdated
@@ -13,3 +13,24 @@ | |||
// Given someone's weight in kg and height in metres | |||
// Then when we call this function with the weight and height | |||
// It should return their Body Mass Index to 1 decimal place | |||
|
|||
|
|||
function ibmCalculator() { |
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.
What would happen if you had a different height or weight?
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.
I understand now why it was giving the same results. I removed the constant from inside the function and fixed the height units.
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.
Fix the units/ removed the constant values
Sprint-2/myexc2.js
Outdated
`current output: ${currentOutput}, target output: ${targetOutput}` | ||
);*/ | ||
|
||
function formatAs12HourClock(time) { |
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.
What would happen if the time was in the afternoon?
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.
It wouldn't work. Fix the function to the 12 hours format.
LONDON | GISLAINE_DELLA_BELLA | MODULE-STRUCTURING-AND-TESTING-DATA | SPRINT-2
Self checklist
Questions
Hello Volunteer, good morning
Here are my exercises for review.
Thank you for taking the time to review them. I appreciate it,
Gislaine