-
-
Notifications
You must be signed in to change notification settings - Fork 245
London | Sep-2025 | Gislaine Della Bella | Structuring and Testing Data | Sprint-1 #739
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
slice() Math.floor() Math.random() lastIndexOf() replaceAll()
dquote>
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
1 similar comment
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
jennethydyrova
left a comment
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 @Della-Bella! Great effort working through these exercises!
A few things to work on in this PR and in all subsequent ones:
-
Proofread your answers - there are quite a few typos that make your explanations harder to follow. A quick review can make a big difference!
-
Clean up your code - please remove:
- Unused/commented-out code and scratch work
- Personal note comments
package-lock.jsonfile (this should never be committed to the codebase as it's a very large file and doesn't need to be here)
This keeps your PRs clean and makes your code easier for others to understand.
I've left specific comments on individual questions. Keep up the good work! 💪
| // Line 1 is a variable declaration, creating the count variable with an initial value of 0 | ||
| // Describe what line 3 is doing, in particular focus on what = is doing | ||
|
|
||
| //line 3 is a statment. It is adding 1 to the value of the variable count |
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.
Good observation about the addition! One thing to refine: is = doing the adding or is it doing something else? What's the difference between + and = in this line?
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 @jennethydyrova ,
the + is adding and the = is Assing the new valeu to the variable "count
| let initials = ``; | ||
|
|
||
| // https://www.google.com/search?q=get+first+character+of+string+mdn | ||
| let initials= `${firstName.charAt(0)} ${middleName.charAt(0)} ${lastName.charAt(0)}`; |
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.
Your initials variable will hold "C K J" value, does it exactly match the requirement?
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 left a "test"i was seeying if it was working. Now I hae deleted it and the out put is : C K J
;)
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.
Please see output requirement on L4. Does your output match the requirement?
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 got the error now. I removed the spaces on CJK. ;)
| let initialsSecond = `${firstName.charAt(3)} ${middleName.charAt(2)} ${lastName.charAt(4)}`; | ||
|
|
||
| console.log (initials, initialsSecond); |
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.
Is this needed for the solution? If not, let's remove it to keep the PR focused.
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.
agree, i was practising some changes and forgot to delete it.
|
|
||
| // (All spaces in the "" line should be ignored. They are purely for formatting.) | ||
|
|
||
| //home / user /dir / file.txt; |
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.
Same as previous comment, is this and everything after line 27 needed for the solution? If not, let's remove it to keep the PR focused.
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.
;) done
| //(maximum - minimum + 1) = get maximum number 100 extract the minimum 1 add +1 to incluide 100. | ||
| //+ minimum add 1 | ||
|
|
||
| //math.radom = gets randm number between 0 and 1 but never 1 so we add +1 to incluide 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.
You're onto something here, but I think you're mixing two ideas. Math.random() never returning 1 is true, but that's not why we have +1 in the formula. What would happen if the formula was Math.random() * (maximum - minimum) + minimum? Try it with max=100, min=1. What range of numbers would you actually get?
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.
@Della-Bella you might have skipped this comment
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 Jennete, I modified the code without the -1 and got it would never get 100 random would go up to 99. got t know. So the +1 is essential to the maximum value can be 100. thank you
| // 8760 / 60 equals 146 minutes | ||
|
|
||
| // e) What do you think the variable result represents? Can you think of a better name for this variable? | ||
| // represents how long in time is the movie. could be caled= const timeMovie |
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.
Good thinking about naming! Look at how other variables are named in this code (like totalMinutes). Can you make "timeMovie" follow the same naming style? (Hint: in JS naming convention for variables usually follows descriptor + noun pattern)
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.
maybe movieTotalLength
| // i guess it wouldnt worrk for negative numbers but actualy evething envolves time is dificult to | ||
| //my mind explain. I need to search for more simples expamples to associete this Reminder operetar in time. | ||
| // this was a dificult mind flows to me :( |
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.
Good catch on negative numbers!
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.
;)
| // so sbtstring start form 0 and the length has 3 = 399 | ||
|
|
||
|
|
||
| // line 8. We declare variale "const paddedPenceNumberString" make sure the number number has least 3 digits |
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.
You said padStart "makes sure the number has at least 3 digits", that's correct. But why do we need exactly 3 digits? Try running the code with penceString = "9p" and trace through what happens.
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 "fills" 0.09p add the 0,0 to be sure it has 3 digits for money format.
|
|
||
| /// lines 14 to 16= const to the pence: the start indext for Substring will be 3-2= 1 | ||
| // substring with 1 argument wil start on the given indes and goes until the end = 99 | ||
| // padending (2, "0") will keep only 2 digits =99 |
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 think you might be confusing what padEnd does. You said it "will keep only 2 digits = 99". Does it remove digits, or does it do something else? What happens if the string is already 2 characters long vs. if it's only 1 character? Maybe try an example to see.
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.
true i got confused . padend make sure the pence part has 2 digits. if it dosen;t padend will add the 0 to it. if it has already 2 digits will stay the same
| // it will not work becase Slice is a string methodo. | ||
| // To work here need to convert the number to string |
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.
Spot 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.
Thanks, @jennethydyrova, for your time reviewing my work. Ib will remember about the extra and personal coments. Make the PR's clear ;)
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
1 similar comment
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
|
Hi @Della-Bella! I've left a couple more comments, but I just noticed you haven't changed the label to "Needs Review" yet. Feel free to disregard them if you're still working on the PR, happy to take another look once you're ready! |
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
1 similar comment
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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). |
jennethydyrova
left a comment
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 @Della-Bella! I see you made some changes but you still haven't addressed quite a few of my comments. I didn't point out to all of them in this round of review but please go over each comment and try to resolve them. Also, please make sure you reduce number of typos in your work, there are quite a few of them.
| // 3 functions: | ||
| // carPrice = Number(carPrice.replaceAll(",", "")); | ||
| // priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," "")); | ||
| // const percentageChange = (priceDifference / carPrice) * 100; |
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.
is this a function call?
| // const percentageChange = (priceDifference / carPrice) * 100; | ||
|
|
||
| // 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 was in line 5 missing a coman between the get to replace "" |
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.
typo in comma
| // lines 1 and 2 , 7 and 8 | ||
|
|
||
| // e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? | ||
| // it is converting the numbers prices to real numbers replace the commnas to empty string so takrs the commans out |
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 think you missed this comment. Your explanation just reads the line but doesn't explain what it actually does.
| // For the piece of code above, read the code and then answer the following questions | ||
|
|
||
| // a) How many variable declarations are there in this program? | ||
| // 4 on lines : 1, 3 and 6 and 9 |
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.
Same, this comment is not addressed.
|
Your PR's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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's title isn't in the expected format. Please check the expected title format, and update yours to match. Reason: Sprint part (Structuring and Testing Data) doesn't match expected format (example: 'Sprint 2', without quotes) 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. |
|
Another point, you shouldn't change label to |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Thank you for your time to review my code 👩🏻💻