Skip to content

London | 26-ITP-Sep | Shirin Panahian | Sprint 2 | Complete Sprint 2 Coursework - #1545

Open
shirinpanahian wants to merge 22 commits into
CodeYourFuture:mainfrom
shirinpanahian:coursework/sprint-2
Open

shirinpanahian wants to merge 22 commits into
CodeYourFuture:mainfrom
shirinpanahian:coursework/sprint-2

Conversation

@shirinpanahian

Copy link
Copy Markdown

Learners, PR Template

Self checklist

  • I have titled my PR with Region | Cohort | FirstName LastName | Sprint | Assignment Title
  • My changes meet the requirements of the task
  • I have tested my changes
  • My changes follow the style guide

Task code

CYF-1039

Changelist

I solve and complete every 4 section and understand how write the java code and find the error.

@netlify

netlify Bot commented Sep 19, 2026

Copy link
Copy Markdown

Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 7fa22d6
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab032634e62a9000806dca5
😎 Deploy Preview https://deploy-preview-1545--cyf-onboarding-module.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
2 paths audited
Performance: 99 (🔴 down 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 86 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@shirinpanahian shirinpanahian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 19, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 19, 2026
@github-actions

This comment has been minimized.

@shirinpanahian shirinpanahian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026
@github-actions

This comment has been minimized.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026
@shirinpanahian shirinpanahian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work on the interpret section. All five answers in 1-percentage-change.js are right, including the declarations, which people often get wrong.

A few things to fix:

  1. 1-key-exercises/3-paths.js line 16, see my comment.

  2. 1-key-exercises/4-random.js line 10, see my comment.

  3. 3-mandatory-interpret/2-time-format.js answer f), see my comment.

  4. 2-mandatory-errors/1.js line 6, see my comment.

  5. Could you run Prettier on the files you have changed? Most of them are not formatted at the moment.

Add the Needs Review label again when you have pushed.

Comment thread Sprint-2/1-key-exercises/3-paths.js Outdated
const ext = ;

// https://www.google.com/search?q=slice+mdn No newline at end of file
const dir = filePath.slice(0,`${lastSlashIndex}`-1);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run this file and read the dir line carefully. It prints .../week-1/interpre, and the folder is called interpret. One character is being lost. What is the - 1 doing at the end of this line, and does slice need it?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The - 1 makes the slice stop one character too early, which removes the t from interpret. It isn’t needed. thank you for mention .

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's it, the dir line prints the full folder name now.

Comment thread Sprint-2/1-key-exercises/4-random.js Outdated
//num represents a random whole number between 1 and 100,
//first we calculate value inside parentheses(maximum - minimum +1) = 100 -1 + 1 =100
// math.random return number between 0 and 1
// math.random() * 100 give us a integer number

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have a look at this line again. Try running console.log(Math.random() * 100) a few times. Is what you get back an integer? If it were, what would be left for Math.floor to do on the next line?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I write wrong, Math.random() * 100 does not give us an integer. It gives us a decimal number between 0 and 100 for example 0.83488 *100 = 83.488. This is why we use Math.floor() . Math.floor(83.488) rounds the number down to 83. Then we add 1, giving us 84.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, exactly that.

// another name could be movieTime

// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
// This code works for normal positive number representing but for negative number and very big number it is not working No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Negative numbers are right. A very big number is fine though, try 999999 and see. Two things worth trying instead: 59, and a number with a decimal like 90.5. What does each one print, and would you show a time that way?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code work for big number, I try 999999 and it return correct number. However, if movieLength = 90.5, it prints 0:1:30.5. This is not a good way to show a time because the seconds contain decimals. So the code works properly for whole numbers, but not for negative numbers and decimal numbers because the result can contain decimal values.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good. 59 is worth a try too: it prints 0:0:59, which is the other thing that looks wrong.

Comment thread Sprint-2/2-mandatory-errors/1.js Outdated
let age = 33;
age = age + 1;
console.log(`${age}`);
//We should use let if we want to change the value. No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your fix is right. In 2.js, 3.js and 4.js you also wrote down the message node printed, which is what this section asks for. What did node say here before you changed const to let?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before I changed const to let node show this error message: (Assignment to constant variable.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the one.

@abdishakoor-dev abdishakoor-dev added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 20, 2026
@shirinpanahian shirinpanahian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All four sorted, and dropping the big-number claim in f) was the right call.

One thing left before I mark this Complete: Prettier still flags three files, 1-key-exercises/2-initials.js and both markdown files in 4-stretch-explore. You clearly ran it on the files you were editing, these are the ones that got missed.

Rather than chasing them file by file, turn on format on save. Then every file you touch is formatted when you hit save and this stops coming up in future PRs: https://github.com/CodeYourFuture/Module-JavaScript-Fundamentals/blob/main/practical_guide.md

There is also a note inline on 3-paths.js, not a blocker.

Add the Needs Review label again once you have pushed.

Comment thread Sprint-2/1-key-exercises/3-paths.js Outdated
const ext = ;

// https://www.google.com/search?q=slice+mdn No newline at end of file
const dir = filePath.slice(0, `${lastSlashIndex}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The - 1 is gone and the folder name is complete now, good. Why the backticks around lastSlashIndex though? It is already a number, so this turns it into a string and slice converts it straight back.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary backtick

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backticks gone, and the line reads clearly now.

@abdishakoor-dev abdishakoor-dev removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026
@shirinpanahian shirinpanahian added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026
@shirinpanahian shirinpanahian removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 20, 2026

@abdishakoor-dev abdishakoor-dev left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All fixed, marking this as complete, well done. Format on save will save you this round in every sprint from here.

@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 20, 2026
@shirinpanahian shirinpanahian added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Complete Volunteer to add when work is complete and all review comments have been addressed. labels Sep 20, 2026
@abdishakoor-dev abdishakoor-dev added Complete Volunteer to add when work is complete and all review comments have been addressed. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Reviewed Volunteer to add when completing a review with trainee action still to take. labels Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Complete Volunteer to add when work is complete and all review comments have been addressed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants