Skip to content

Manchester | 26-ITP-Sep | Gustarv Nchitu | Sprint 2 | Coursework/sprint 2 - #1593

Open
Jestavo1 wants to merge 13 commits into
CodeYourFuture:mainfrom
Jestavo1:coursework/sprint-2
Open

Jestavo1 wants to merge 13 commits into
CodeYourFuture:mainfrom
Jestavo1:coursework/sprint-2

Conversation

@Jestavo1

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

Completed All Sprint2 exercises

@netlify

netlify Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit bccc1dd
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab6b0d7cea89200080e7274
😎 Deploy Preview https://deploy-preview-1593--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: 100 (no change 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.

@Jestavo1 Jestavo1 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 25, 2026

@cjyuan cjyuan 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.

Code looks good. I just have a few comments.

Comment on lines +2 to +4
//const 24hourClockTime = "20:53";
// I predict the code will give an error because a variable name cannot start with a number.
const twelveHourClockTime = "8:53pm"; 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 understanding is correct. There were two variable declarations in the original code though.

// c) The % operator gives the remainder after dividing movieLength by 60.
// c) The % operator gives the remainder after dividing movieLength by 60. 60 represents the number of seconds in one minute.
// d) It subtracts the remaining seconds from the movie length and then divides by 60 to convert the remaining seconds into total minutes.
// e) The variable result represents the movie duration in hours, minutes and seconds. A better name would be movieDuration.

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 name movieDuration does not quite indicate the value stored in the variable
is a formatted string in the form "2:12:02".

Could you suggest a more descriptive name?

What is the return value of `prompt`?
Calling the alert function displays a pop-up message to the user.

Calling the prompt function asks the user for information. The return value of prompt is the information the user entered.

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.

When a program uses prompt() to ask the user for input, how can it tell whether the user clicked "OK" or "Cancel"?

@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 Sep 26, 2026
Comment on lines 6 to 8
// In this exercise, you will need to work out what num represents?
// 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

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.

I just noticed you missed this exercise.

Could you give a precise description what each of these expressions does, and the range of the numbers it may produce?

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

Note: To describe a range of numbers, we could use the concise and precise interval notation:

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

For example, $x$ is a number in $[1, 10)$ means:

$x$ is a number between 1 and 10, including 1 but excluding 10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Reviewed Volunteer to add when completing a review with trainee action still to take.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants