Skip to content

Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework#1369

Open
Tobias-Amaechina wants to merge 54 commits into
CodeYourFuture:mainfrom
Tobias-Amaechina:coursework
Open

Birmingham | 26-ITP-May | Tobias Amaechina | Sprint 1 | coursework#1369
Tobias-Amaechina wants to merge 54 commits into
CodeYourFuture:mainfrom
Tobias-Amaechina:coursework

Conversation

@Tobias-Amaechina

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

Changelist

This is PR for coursework Solutions for Sprin-1 of the "Module-Structuring- and Testing-Data Module, it covers key exercises on JavaScript fundamentals (variable assignments, string manipulations , String methods ,random numbers , and mandatory error fixing activities along with interpretation exercises that test understanding of code behaviour and syntax .
1-key-exercises/ — 4 files with solutions for count, initials, paths, and random number generation
2-mandatory-errors/ — 5 files fixing syntax/logic errors (comments, variable scope, type issues, naming)
3-mandatory-interpret/ — 3 files with detailed explanations of code behavior
4-stretch-explore/ — 2 files exploring browser APIs and object concepts

… and it reads number, I have to comment out slice method line of code
… original code to see that error message says TypeError: cardNumber.slice is not a function
…e quotes around the numbers and printing last4Digits
…$ so the the first varible was name was updated to start with doller sign
Comment on lines 6 to +8
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

let initials = ``;
let initials = `"${firstName[0]}${middleName[0]}${lastName[0]}"`;

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.

Note: Usually the double quotes surrounding a string are not part of the sting value; they are only used to indicate the boundary of the string.

No change needed.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Noted , Thanks

Comment thread Sprint-1/2-mandatory-errors/3.js Outdated
@@ -1,9 +1,17 @@
const cardNumber = 4533787178994213;
const cardNumber = "4533787178994213";

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.

Suppose you were not allowed to modify the statement const cardNumber = 4533787178994213;
(that is, keep the variable's value unchanged).
How would you modify the code (through type conversion) to still being able to use .slice(-4) to extract the last 4 digits from the given number.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Used .toString() method to cast the number to string type

Comment thread Sprint-1/2-mandatory-errors/4.js Outdated
Comment on lines +1 to +2
const $12HourClockTime = "8:53pm";
const _hourClockTime = "20:53"; 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.

Identifiers that begin with _ or $ are valid variable names. However, they are usually used by convention to signal special meaning.

Could you explore names that start with alphabets instead? Feel free to ask AI for suggestion.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Used best practices to rename the variable as recommended in JavaScript

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?

// b) Run the code and identify the line where the error is coming from - why is this error occurring? How can you fix this problem?
// The error is occurring on line 5., and it's a SyntaxError: missing , The error is due to a missing comma in the replaceAll() method. The correct syntax should be replaceAll(",", ""). To fix this problem, we need to add the missing comma in the replaceAll() method on line 5

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.

We could more precisely describe "A comma is missing between "," and "" in the function call" as:
A comma is missing between the ___________s.

Could you look up the programming term that belongs in the blank?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I have giveb the right terminology to the variable in the blank function call

@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 Jun 23, 2026
@Tobias-Amaechina

Copy link
Copy Markdown
Author

All issus raised has been resolved

@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^Sprint-1/

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@Tobias-Amaechina

Copy link
Copy Markdown
Author

All issues raised has been addressed

@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^Sprint-1/

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

The changed files in this PR don't match what is expected for this task.

Please check that you committed the right files for the task, and that there are no accidentally committed files from other sprints.

Please review the changed files tab at the top of the page, we are only expecting changes in this directory: ^Sprint-1/

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@cjyuan

cjyuan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Deleted files are also considered "changes". Here's one way to fix the problem.

Reverting Changes

One way to revert changes to a file is via the git restore command.

First, locate a commit before the file was modified. It could be the first commit you made, assuming the branch started in a clean state.

Next, record the first 7 characters of the commit SHA.

Suppose the file is path/to/file, and you want to restore the file to its state before the commit with SHA 1234567.
The command is:

git restore --source=1234567^ path/to/file

In your case, path/to/file is Sprint-2. Since Sprint-2 is a folder, the restore would apply to all files in Sprint-2. You may want to backup the files in Sprint-2 folder first if you still need them later.

After the file is restored, make a commit and push the changes to GitHub.

@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@github-actions

Copy link
Copy Markdown

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 24, 2026
@cjyuan

cjyuan commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Did you restore the file content by copying-pasting the code?

Different editors on different operating systems may format the last line differently. The safest way to restore the files are either through git restore or copy/paste the whole files.

@Tobias-Amaechina Tobias-Amaechina added the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 25, 2026
@github-actions

Copy link
Copy Markdown

Your PR couldn't be matched to an assignment in this module.

Please check its title is in the correct format, and that you only have one PR per assignment.

If this PR is not coursework, please add the NotCoursework label (and message on Slack in #cyf-curriculum or it will probably not be noticed).

If this PR needs reviewed, please add the 'Needs Review' label to this PR after you have resolved the issues listed above.

@github-actions github-actions Bot removed the Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. label Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Module-Structuring-And-Testing-Data The name of the module. 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