-
-
Notifications
You must be signed in to change notification settings - Fork 117
ITP JAN25 | KATARZYNA_KAZIMIERCZUK | STRUCTURING_AND_TESTING_DATA | SPRINT2 #434
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
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 have left you some feedback for your work in Sprint-2.
This branch should not contain modified files in Sprint-1 and Sprint-3 folders.
Since this PR has not yet been reviewed, I will removed the "Complete" label for now. You can add them after you have made the necessary changes.
let heightCM = heightM/100 | ||
return parseFloat((weight / (heightCM*heightCM))).toFixed(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.
What type of value do you think the function should return? A number or a string?
Does your function return the type of value you think it should return?
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 was incorrect, it is now fixed
//3 | ||
// Call formatTimeDisplay with an input of 61, now answer the following: | ||
|
||
// b) What is the value assigned to num when pad is called for the first time? | ||
// =============> write your answer here | ||
// 61 | ||
|
||
// c) What is the return value of pad is called for the first time? | ||
// =============> write your answer here | ||
// num 0 | ||
|
||
// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer | ||
// =============> write your answer here | ||
// TypeError: num.toString(...).padStart is not a function an error shows | ||
|
||
|
||
// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer | ||
// =============> write your answer here | ||
// TypeError: num.toString(...).padStart is not a function an error shows |
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.
"Python Tutor: Visualize Code" does not support newer version of JS, and that's why you get the error " TypeError: num.toString(...).padStart is not a function".
The answers to (b) is not quite correct.
Question (b) basically asks, among the function calls, pad(totalHours)
, pad(remainingMinutes)
, and pad(remainingSeconds)
at line 11, which function gets called first? If you can figure out which function gets called first, then what is the parameter of that function call?
Forget about the Code Visualizer. What is your expected answers for (d) and (e).
You can ask ChatGPT for second opinion or you can execute the code in browser's JS console.
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.
fixed in the other PR
Apologies, I now added a replacement PR not including sprint 1 and 2 coursework |
You don't have to create a new branch. One way to fix the branch is replace the "modified files" in Sprint-1 and Sprint-3 folders by the same files from your
|
If you insist of using the new branch, then you will have to close this PR, and then respond to the feedback I left here in your new branch. |
thank you! everything is fixed on this PR |
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.
Still have room to improve.
@@ -23,17 +23,16 @@ function formatTimeDisplay(seconds) { | |||
|
|||
// b) What is the value assigned to num when pad is called for the first time? | |||
// =============> write your answer here | |||
// 61 | |||
// 60 |
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 answer is not 60. Please retry.
|
||
// c) What is the return value of pad is called for the first time? | ||
// =============> write your answer here | ||
// num 0 | ||
// 00 |
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.
If the type of the value is a string, we can denote it as "00"
to make it clearer its type and value.
@@ -15,7 +15,7 @@ | |||
// Use the MDN string documentation to help you find a solution | |||
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase | |||
|
|||
const convertToUpper = (word) => word.toUpperCase() | |||
const convertToUpper = (word) => | |||
input.replace(/ /g, "_").console.log(convertToUpper("kaska")); |
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.
Does this statement (at line 19) work?
let heightCM = heightM / 100; | ||
return parseFloat(weight / (heightCM * heightCM)).toFixed(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.
What type of value do you think the function should return? A number or a string?
Does your function return the type of value you think it should return?
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.