Skip to content

Conversation

@khalidbih
Copy link

@khalidbih khalidbih commented Oct 29, 2025

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 :
I have completed all the exercises in sprint 1.

@khalidbih khalidbih added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Module-Structuring-And-Testing-Data The name of the module. labels Oct 29, 2025
Copy link
Contributor

@cjyuan cjyuan left a comment

Choose a reason for hiding this comment

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

Can you include a brief description of this PR in the PR description?

// Try breaking down the expression and using documentation to explain what it means
// It will help to think about the order in which expressions are evaluated
// Try logging the value of num and running the program several times to build an idea of what the program is doing

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you also try explaining the meaning of each sub-expression?

    Math.random() 
    Math.random() * (maximum - minimum + 1)
    Math.floor(Math.random() * (maximum - minimum + 1))
    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.

Math.random(): Gives a random number between 0 and 1.
Math.random() * (maximum - minimum + 1): Stretches the random number so it can cover all the numbers in the range, stretches 0 to 1 into 0 to 100.
Math.floor(Math.random() * (maximum - minimum + 1)): Removes the decimal part so we get a whole number.
Math.floor(Math.random() * (maximum - minimum + 1)) + minimum: Adding the minimum moves all the numbers up, so the lowest equals the minimum I chose.

Copy link
Contributor

Choose a reason for hiding this comment

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

Phrases like "a number between X and Y" are not precise enough in a program specification, because they do not clearly state whether the endpoints X and Y are included.

You can consider using the concise and precise interval notation to describe a range of values.

  • [, ] => inclusion
  • (, ) => exclusion

If -5 < x <= 50, we can say x is a number in the interval (-5, 50].

Can you lookup the return value of Math.random() and describe its return value using this notation?

@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 Nov 6, 2025
@khalidbih khalidbih added Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. and removed Reviewed Volunteer to add when completing a review with trainee action still to take. labels Nov 7, 2025
@khalidbih
Copy link
Author

Can you include a brief description of this PR in the PR description?

I did the description for my PR.
Thank you for reviewing my PR

@cjyuan
Copy link
Contributor

cjyuan commented Nov 7, 2025

Can you respond to all of my comments?

You can view all the inline comments on your PR on GitHub (#823).

@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 Nov 7, 2025
@khalidbih
Copy link
Author

Can you include a brief description of this PR in the PR description?

I added the brief description to my Pull Request. Thank you for reviewing.

@khalidbih
Copy link
Author

Can you respond to all of my comments?

You can view all the inline comments on your PR on GitHub (#823).

Sorry, my comments were pending; I forgot to submit the review. Thank you for reviewing my PR.

@khalidbih khalidbih removed the Reviewed Volunteer to add when completing a review with trainee action still to take. label Nov 7, 2025
@khalidbih khalidbih added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Nov 7, 2025
@cjyuan
Copy link
Contributor

cjyuan commented Nov 7, 2025

Changes look good. Well done.

@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. labels Nov 7, 2025
@khalidbih
Copy link
Author

Changes look good. Well done.

Thank you so much.

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