Skip to content

London | JAN-2026 ITP | Ebrahim Moqbel | Sprint 1 | Coursework#1074

Open
Ebrahim-Moqbel wants to merge 13 commits intoCodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-1
Open

London | JAN-2026 ITP | Ebrahim Moqbel | Sprint 1 | Coursework#1074
Ebrahim-Moqbel wants to merge 13 commits intoCodeYourFuture:mainfrom
Ebrahim-Moqbel:coursework/sprint-1

Conversation

@Ebrahim-Moqbel
Copy link

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

Changelist

completed all of the bellow filles :
Key exercises
Mandatory errors
Mandatory interpret
Stretch exploration

Questions

N/A

@github-actions

This comment has been minimized.

@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Feb 26, 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 Feb 26, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel changed the title London | JAN-2026 ITP | Ebrahim Moqbel \ Sprint 1 | Coursework London | JAN-2026 ITP | Ebrahim Moqbel | Sprint 1 | Coursework Feb 26, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. 📅 Sprint 1 Assigned during Sprint 1 of this module Module-Structuring-And-Testing-Data The name of the module. labels Feb 26, 2026
@cjyuan cjyuan 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 Mar 5, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 5, 2026
// math.floor will make the number as a whole and remove any decimals or more likely to round the the nearest whole number
// math.random returns a random number in [0,1)
// (maximum - minimum + 1) provide a range of generated random number
// num is a random whole number [1,100)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the value of num be 100? That is, canthe generated random number include 100?

Copy link
Author

Choose a reason for hiding this comment

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

No the notation ( , ) would exclude the number therefore 100 wouldn't be generated.

Copy link
Contributor

Choose a reason for hiding this comment

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

You figured out Math.random returns a random number in [0, 1).

Can you use the interval notation to describe what each of these expressions does, and the range of the numbers it may produce?

  1. Math.random() * (maximum - minimum + 1)
  2. Math.floor(Math.random() * (maximum - minimum + 1))
  3. Math.floor(Math.random() * (maximum - minimum + 1)) + minimum

Copy link
Author

Choose a reason for hiding this comment

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

  1. math.random() would generate a random number between 0 and 1 multiply it by the maximum inclusively subtracted the minimum exclusively and that's why we have added one.
  2. math.floor() would round the decimal number to the nearest value
  3. math.floor() would do the same and the addition at the end would just ad to the rounded number the minimum

Copy link
Contributor

@cjyuan cjyuan Mar 18, 2026

Choose a reason for hiding this comment

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

Can you instead show the interval of the values that can be generated by each of the expressions?
I will mark this PR as complete first.

Note: Math.floor() does not round a number to the nearest integer.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@cjyuan
Copy link
Contributor

cjyuan commented Mar 6, 2026

What about this comment: #1074 (comment)


Please note that in CYF courses, the recommended way to inform the reviewer of your changes is to do both of the following:

  • Reply to their feedback.
    • In the responses, clarify how each piece of feedback was addressed to demonstrate that you've carefully reviewed the suggestions.
      • You may find the suggestions in this PR Guide useful.
    • Your response may trigger a notification (depending on the reviewer's settings), helping ensure they’re aware of the updates you’ve made.
  • Replace the "Reviewed" label by a "Needs review" label (which you have done -- great!)
    • Without this label, the reviewer would not know if your changes is ready to be reviewed.

@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 6, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 10, 2026
@cjyuan cjyuan removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 10, 2026
@Ebrahim-Moqbel Ebrahim-Moqbel added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Mar 17, 2026
@cjyuan cjyuan 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 Mar 18, 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. Module-Structuring-And-Testing-Data The name of the module. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants