Skip to content

Sheffield | May-2025 | Waleed-Yahya Salih-Taha | Sprint1 #638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Bluejay600
Copy link

@Bluejay600 Bluejay600 commented Jul 3, 2025

Learners, PR Template

Self checklist

  • I have committed my files one by one, on purpose, and for a reason
  • I have titled my PR with REGION | COHORT_NAME | FIRST_NAME LAST_NAME | PROJ_NAME
  • I have tested my changes
  • My changes follow the style guide
  • My changes meet the requirements of this task

Changelist

In this PR I have worked through and fixed the key exercises and checked the mandatory Errors plus interpreted them into corrected and executable code.

Questions

Ask any questions you have for your reviewer.

2. fixed the error by changing the declaration of age to 'let', and reassignment.
…ared.

2. to fix it , I declared the variable before using it in console.log
…umber while it's a string.

2. To fix this error, we need to convert the `cardNumber` to a string before using the `slice` method.
…s with a digit.

2. To fix this error, I renamed the variable to start with a letter or an underscore.
2. Ran the code and identified the line 7 where the error is coming from .
3.  Identified all the lines that are variable reassignment statements.
4. Identified all the 5 lines that are variable declarations.
5. Described what the expression Number(carPrice.replaceAll(",","")) is doing.
6. corrected the code.
@Bluejay600 Bluejay600 added 📅 Sprint 1 Assigned during Sprint 1 of this module Needs Review Participant to add when requesting review labels Jul 3, 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.

Why name the project in the PR title "test branch"?

Comment on lines +15 to +23
// There are 5 variable declarations in this program:
// 1. `movieLength` on line 1
// 2. `remainingSeconds` on line 3
// 3. `totalMinutes` on line 4
// 4. `remainingMinutes` on line 6
// 5. `totalHours` on line 7

// b) How many function calls are there?
// There are no function calls in this program. All operations are performed using arithmetic operators and string interpolation.
Copy link
Contributor

Choose a reason for hiding this comment

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

There are more than 5 variable declarations and more than 0 function calls.

Copy link
Author

Choose a reason for hiding this comment

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

we declare a variable using (let & const). how come we have more than 5 variable declaration?
we only have 4 if we are talking about the given code not the corrected one.

Copy link
Contributor

Choose a reason for hiding this comment

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

I counted 6 const in the code at lines 1-9 in Sprint-1/3-mandatory-interpret/2-time-format.js.

// 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1): removes the trailing 'p' from the string, resulting in "399".
// 3. const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0"): pads the string with leading zeros to ensure it has at least 3 characters, resulting in "399" (no change needed here since it already has 3 characters).
// 4. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2): extracts the pounds part of the string by taking all characters except the last two, resulting in "3".
// 5. const pence = paddedPenceNumberString.substring(paddedPenceNumber
Copy link
Contributor

Choose a reason for hiding this comment

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

The description at line 33 seems incomplete.

On separate note, could we expect this program to work as intended for any valid penceString if we deleted .padEnd(2, "0") from the code? In other words, do we really need .padEnd(2, "0") in this script?

Copy link
Author

Choose a reason for hiding this comment

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

.padEnd(2, "0") ensures that a string is at least 2 characters long by padding it with "0" on the right.
yes, we need .padEnd(2, "0") to make sure there are always two digits to work with.

Copy link
Contributor

Choose a reason for hiding this comment

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

Have you tried executing the script without padEnd(2, "0") using different values of penceString to validate your expectation?

@cjyuan cjyuan added Reviewed Volunteer to add when completing a review and removed Needs Review Participant to add when requesting review labels Jul 4, 2025
@Bluejay600 Bluejay600 changed the title Sheffield | May-2025 | Waleed-Yahya Salih-Taha | Sprint1 test branch Sheffield | May-2025 | Waleed-Yahya Salih-Taha | Sprint1 Jul 5, 2025
@Bluejay600
Copy link
Author

Why name the project in the PR title "test branch"?

I have now changed the name to sprint1

@cjyuan
Copy link
Contributor

cjyuan commented Jul 6, 2025

Changes look good. I will mark this PR as complete first.

Can you also respond to this comment?
image

@cjyuan cjyuan added Complete Volunteer to add when work is complete and review comments have been addressed and removed Reviewed Volunteer to add when completing a review labels Jul 6, 2025
@Bluejay600 Bluejay600 closed this Jul 11, 2025
@Bluejay600 Bluejay600 reopened this Jul 12, 2025
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 review comments have been addressed 📅 Sprint 1 Assigned during Sprint 1 of this module
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants