Skip to content

Birmingham | 26-ITP-May | Toluwalase Tiamiyu | Sprint 1 | Coursework#1380

Open
TTiamiyu wants to merge 21 commits into
CodeYourFuture:mainfrom
TTiamiyu:coursework/sprint-1
Open

Birmingham | 26-ITP-May | Toluwalase Tiamiyu | Sprint 1 | Coursework#1380
TTiamiyu wants to merge 21 commits into
CodeYourFuture:mainfrom
TTiamiyu:coursework/sprint-1

Conversation

@TTiamiyu

@TTiamiyu TTiamiyu commented Jun 22, 2026

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

In this PR the coursework to test the basics of structuring and testing data was done and committed regularly

@TTiamiyu TTiamiyu 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. labels Jun 22, 2026
@Gopi-2001 Gopi-2001 added the Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. label Jun 25, 2026
@Gopi-2001 Gopi-2001 self-assigned this Jun 25, 2026
Comment thread Sprint-1/1-key-exercises/1-count.js Outdated
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing

The = served as the executer of the assignment operation. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: In JavaScript a single-line comment starts with // and is ignored by the JavaScript engine. Can you look where all can you use it.

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.

Thank you for your suggestion, i have effected the comment tag to my response.

Comment thread Sprint-1/1-key-exercises/1-count.js Outdated
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
// Describe what line 3 is doing, in particular focus on what = is doing

The = served as the executer of the assignment operation. No newline at end of file

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What will be the new value of count after statement at line 3 is executed ?

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.

The new count value would would be '0 + 1' = 1.

Comment thread Sprint-1/1-key-exercises/2-initials.js Outdated

// Export the initials for testing instead of returning at top-level
module.exports = getInitials;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

You have properly use function and the output is the expected string "CKJ", but instead of using a function, can you try to get the same result by Declare a variable called initials

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.

There are a couple of ways to declare initials using the 'let' statement, i have used one of them in my recent commit.

Comment thread Sprint-1/1-key-exercises/3-paths.js Outdated
const dir = ;
const ext = ;
const dir = ; /Users/mitch/cyf/Module-JS1/week-1/interpret/
const ext = ; file.txt;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is the semicolon position correct while declaring variable dir and ext ?

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 taking the semicolon out as its not required when '=' is in use.

// Create a variable to store the ext part of the variable

const dir = ;
const ext = ;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Think of ways to use slice method extract and store directory part and extension part in the variable dir and ext respectively.

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.

Thank you for your review, i have infused the .slice method and i have used the console.log to recall the answer to 'dir' and 'ext', rather than manually inputting it.

Comment thread Sprint-1/2-mandatory-errors/0.js Outdated
//This is just an instruction for the first activity - but it is just for human consumption
//We don't want the computer to run these 2 lines - how can we solve this problem?

To prevent the computer from executing these lines of code, you can comment them out,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

How will you use multi-line comment for line 4 and 5 ?

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 made use of the " /* " to comment out line 4 and 5.

// Then try updating the expression last4Digits is assigned to, in order to get the correct value

PREDICTION:
//the code wont work because the card number isnt in ("") and the computer wont be able to apply the .slice due to this.

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 is good practice to use single line comment or multiline comment whenever required.

try looking for lines which needs to be ignored by computer in the code.

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 see what you mean and i have commented out the headings i created earlier.

Comment thread Sprint-1/2-mandatory-errors/3.js Outdated
FIX:
const cardnumber = "4533787178994213";
const last4Digits = cardnumber.slice(-4);
console.log(last4Digits);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is there any function that you can use to convert number to string in JS ?

@TTiamiyu TTiamiyu Jun 26, 2026

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 can use String(num) or num.toString() after i have used a "let" declare statement preceding the use of the stated function.


// 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 in line 5, the error is occurring because there was a comma missing here; ("," "").

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Instead of writing comma is missing here, we can put it like "Comma is missing "," and "" for priceAfterOneYear.replaceAll("," "") function call.

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.

Your suggestion is better and i have incorporated it, thank you.

//It will do the math perfectly for most normal positive numbers, but there are a few situations where the code will act wierdly.
//1. Visual problems
//2. Negative numbers
//3.Decimal numbers

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I am not sure about Visual Problems, can you describe what you mean by it.

We can also consider any Non-Integer numbers .

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.

What i mean with this is The "Single Digit" Visual Bug where the output would not look like a normal digital clock.

I was hoping the non integer numbers would be captured under the decimal numbers response i provided

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

Labels

Needs Review Trainee to add when requesting review. PRs without this label will not be reviewed. Review in progress This review is currently being reviewed. This label will be replaced by "Reviewed" soon. 📅 Sprint 1 Assigned during Sprint 1 of this module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants