Skip to content

Manchester | 26-ITP-Sep | Rahana Suleiman | Sprint 2 | Complete Sprint 2 Coursework - #1563

Open
rahanasuleiman8-ship-it wants to merge 18 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:coursework/sprint-2
Open

rahanasuleiman8-ship-it wants to merge 18 commits into
CodeYourFuture:mainfrom
rahanasuleiman8-ship-it:coursework/sprint-2

Conversation

@rahanasuleiman8-ship-it

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

  • Corrected const reassignment errors using let by reordering variable declarations.
  • Fixed TypeError by converting numeric values before string slicing and fixed invalid variable identifiers starting with digits.
  • Fixed missing commas in method arguments and analysed time conversion modulo arithmetic.
  • Documented step-by-step string manipulation (.substring(), .padStart(), .padEnd()) to convert pence to pounds currency format.

…imum, and num aand logged the value of num in my terminal
…gnment and explained the error it causes when attempted
-identify function calls, declarations, aand reassignments.
-verify my code is working when I run console.log()
- document and explain the remainder(%) operator to calculate the remaining seconds after converting total seconds into full minutes.
- provide a better name for the variable 'result' and experiment with different values of movieLength
- Explain the string methods for converting pence to pounds currency format
- Verify output of formatted currency string ('£3.99') via Node.js
@netlify

netlify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for cyf-onboarding-module ready!

Name Link
🔨 Latest commit 88beb1f
🔍 Latest deploy log https://app.netlify.com/projects/cyf-onboarding-module/deploys/6ab17db23c4c3e00085333eb
😎 Deploy Preview https://deploy-preview-1563--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.

@github-actions

This comment has been minimized.

@rahanasuleiman8-ship-it rahanasuleiman8-ship-it added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 21, 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 21, 2026
@Liam310 Liam310 added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Sep 24, 2026
@hey-hammad hey-hammad added Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. and removed Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. labels Sep 26, 2026

@hey-hammad hey-hammad left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good work overall, few changes required. Thanks

// Math.random() returns a random decimal between 0 and 1
// Math.random() * maximum(100) returns a random decimal between 0 and 99.999
// Math.floor() rounds up the decimal to the nearest whole number
// maximum and minimum calculates thee total output of the number(100)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

good start, however the following expression can be explained more.

(maximum - minimum + 1))+ minimum

//Explanation: Yes, my prediction was accurate. JavaScript threw a TypeError because '.slice()' is a string method
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
const cardNumber = '4533787178994213';
const last4Digits = cardNumber.slice(-4);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

thats one way to do it, but can we do it without changing the original value?

const 24hourClockTime = "20:53";
// JavaScript variable names cannot start with a number. They must start with an alphabet(A-Z), an underscore(_), or a dollar sign($). JavaScript is also case sensitive so they have to use camelCase, PascalCase, among others.

const HourClockTime = "8:53pm";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this fixes the issue, but are the variable names descriptive enough of the values they hold?

//ANSWER: The expression movieLength % 60 uses the remainder (%) operator to calculate the number of seconds remaining that can't form a full seconds (8784 % 60 = 24 seconds)

// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
// ANSWER: The expression assigned to totalMinutes means division

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the expression does include division, but please elaborate more what the whole expression is about.

// 1. const penceString = "399p": initialises a string variable with the value "399p"
// 2. const penceStringWithoutTrailingP: uses substring to remove the trailing "p" from "399p", leaving "399"
// 3. const paddedPenceNumberString: padStart() makes sure the string has at least 3 characters, adding "0" if required. If we have "5p" and we remove the "p" we would be left with "5", so padding it to 3 numbers will give us the output ("005")
// const pounds: removes everything except the final two digits, giving "3".

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

it does give 3, however please review the statement again. Think about what the code does and does it match your explanation?

@hey-hammad hey-hammad added Reviewed Volunteer to add when completing a review with trainee action still to take. and removed Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. labels Sep 26, 2026
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.

3 participants