diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index b34cfcfc3..335da9aaf 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,13 +1,13 @@
-# These are supported funding model platforms
-
-github: CodeYourFuture
-patreon: # Replace with a single Patreon username
-open_collective: # Replace with a single Open Collective username
-ko_fi: # Replace with a single Ko-fi username
-tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
-community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
-liberapay: # Replace with a single Liberapay username
-issuehunt: # Replace with a single IssueHunt username
-otechie: # Replace with a single Otechie username
-lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
-custom: https://codeyourfuture.io/donate
+# These are supported funding model platforms
+
+github: CodeYourFuture
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+custom: https://codeyourfuture.io/donate
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
index 5fe8ffd09..3e43fc213 100644
--- a/.github/ISSUE_TEMPLATE/config.yml
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -1,14 +1,14 @@
-blank_issues_enabled: false
-contact_links:
- - name: CYF
- url: contact@codeyourfuture.io
- about: Please report serious issues here.
- - name: Join CYF
- url: https://codeyourfuture.io/volunteers/
- about: Join CYF here
- - name: CYF Slack
- url: codeyourfuture.slack.com
- about: Come to #cyf-syllabus-tech and chat
- - name: CYF Tech Ed
- url: https://github.com/orgs/CodeYourFuture/teams/mentors
- about: CYF mentors on Github
+blank_issues_enabled: false
+contact_links:
+ - name: CYF
+ url: contact@codeyourfuture.io
+ about: Please report serious issues here.
+ - name: Join CYF
+ url: https://codeyourfuture.io/volunteers/
+ about: Join CYF here
+ - name: CYF Slack
+ url: codeyourfuture.slack.com
+ about: Come to #cyf-syllabus-tech and chat
+ - name: CYF Tech Ed
+ url: https://github.com/orgs/CodeYourFuture/teams/mentors
+ about: CYF mentors on Github
diff --git a/.github/ISSUE_TEMPLATE/pd-assignment.yml b/.github/ISSUE_TEMPLATE/pd-assignment.yml
index c8bd22980..3c739f74d 100644
--- a/.github/ISSUE_TEMPLATE/pd-assignment.yml
+++ b/.github/ISSUE_TEMPLATE/pd-assignment.yml
@@ -1,59 +1,59 @@
-name: PD Coursework
-description: Assign a piece of PD coursework
-title: "[PD]
"
-labels: [PD, 🏝 Priority Stretch, 🐇 Size Small]
-body:
- - type: markdown
- attributes:
- value: |
- Thanks for taking the time to assign this coursework!
- - type: input
- attributes:
- label: Coursework content
- validations:
- required: true
- - type: input
- attributes:
- label: Estimated time in hours
- description: (PD has max 4 per week total)
- validations:
- required: true
- - type: textarea
- attributes:
- label: What is the purpose of this assignment?
- description: Clearly explain the purpose of this assignment and how trainees can evaluate this.
- validations:
- required: true
- - type: textarea
- attributes:
- label: How to submit
- description: State in clear steps how a trainee can submit this assignment.
- placeholder: |
- Copy the Google doc to your own Google Drive
- Complete the work assigned
- When you are ready, move your document to your class Drive
- validations:
- required: true
- - type: textarea
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give more context
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- - type: markdown
- attributes:
- value: |
- **Thank you so much.**
-
- Please now complete this ticket by filling in the options on the sidebar.
-
- 1. Update labels
- - priority -- is this coursework key, mandatory, or stretch?
- - size -- help trainees plan their time with rough estimation
- 2. Add to project backlog
- - add to the project named the same as this repo
- - fill in custom fields -- priority, size, hours, week -- to match this issue
-
- Once your ticket is complete, you may like to check it out on the example project board attached to this repo.
- This is so you understand how trainees will use your work.
+name: PD Coursework
+description: Assign a piece of PD coursework
+title: "[PD] "
+labels: [PD, 🏝 Priority Stretch, 🐇 Size Small]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to assign this coursework!
+ - type: input
+ attributes:
+ label: Coursework content
+ validations:
+ required: true
+ - type: input
+ attributes:
+ label: Estimated time in hours
+ description: (PD has max 4 per week total)
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: What is the purpose of this assignment?
+ description: Clearly explain the purpose of this assignment and how trainees can evaluate this.
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: How to submit
+ description: State in clear steps how a trainee can submit this assignment.
+ placeholder: |
+ Copy the Google doc to your own Google Drive
+ Complete the work assigned
+ When you are ready, move your document to your class Drive
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Anything else?
+ description: |
+ Links? References? Anything that will give more context
+
+ Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
+ - type: markdown
+ attributes:
+ value: |
+ **Thank you so much.**
+
+ Please now complete this ticket by filling in the options on the sidebar.
+
+ 1. Update labels
+ - priority -- is this coursework key, mandatory, or stretch?
+ - size -- help trainees plan their time with rough estimation
+ 2. Add to project backlog
+ - add to the project named the same as this repo
+ - fill in custom fields -- priority, size, hours, week -- to match this issue
+
+ Once your ticket is complete, you may like to check it out on the example project board attached to this repo.
+ This is so you understand how trainees will use your work.
diff --git a/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml b/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
index 1bdba2935..bb0a11bd1 100644
--- a/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
+++ b/.github/ISSUE_TEMPLATE/tech-ed-assignment.yml
@@ -1,80 +1,80 @@
-name: Tech Ed Coursework
-description: Assign a piece of technical coursework
-title: "[TECH ED] "
-labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium]
-body:
- - type: markdown
- attributes:
- value: |
- Thanks for taking the time to assign this coursework!
-
- To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
- We don't just want to tell them what to do, we want to tell them stuff like:
- - why we are doing it
- - what it's "for" (problem-solving, debugging, etc)
- - how long they should spend on it, maximum
- - how to get help
- - how to review it with answers
- - how to get it reviewed from mentors and peers
- - type: input
- attributes:
- label: Link to the coursework
- validations:
- required: true
- - type: textarea
- attributes:
- label: Why are we doing this?
- description: Clearly explain the purpose of this assignment
- validations:
- required: true
- - type: input
- attributes:
- label: Maximum time in hours
- description: (Tech has max 16 per week total)
- validations:
- required: true
- - type: textarea
- attributes:
- label: How to get help
- description: State simply how trainees can get help with this assignment
- placeholder: |
- Share your blockers in your class channel
- https://syllabus.codeyourfuture.io/guides/asking-questions
- - type: textarea
- attributes:
- label: How to submit
- description: State in clear steps how a trainee can submit this assignment.
- placeholder: |
- Fork the repo to your own GitHub account
- Make regular small commits with clear messages
- When you are ready, open a Pull Request to the CYF repo
- Make sure you fill in the PR template provided
- validations:
- required: true
- - type: textarea
- attributes:
- label: How to review
- description: How to get code review and how to self-review
- - type: textarea
- attributes:
- label: Anything else?
- description: |
- Links? References? Anything that will give more context
-
- Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
- - type: markdown
- attributes:
- value: |
- **Thank you so much.**
-
- Please now complete this ticket by filling in the options on the sidebar.
-
- 1. Update labels
- - priority -- is this coursework key, mandatory, or stretch? Pick one.
- - size -- help trainees plan their time with rough estimation. Pick one
- - topics -- add all that seem relevant to you.
- 2. Add to milestone
- - week 1,2,3,4
-
- Once your ticket is complete, you may like to add it to the example project board attached to this repo.
- This is so you understand how trainees will use your work. Nobody has built a board copier yet, so trainees will be doing this step themselves.
+name: Tech Ed Coursework
+description: Assign a piece of technical coursework
+title: "[TECH ED] "
+labels: [Tech Ed, 🏕 Priority Mandatory, 🐂 Size Medium]
+body:
+ - type: markdown
+ attributes:
+ value: |
+ Thanks for taking the time to assign this coursework!
+
+ To support our trainees with planning and prioritising their own learning journey, we want our coursework assignments to be more informative.
+ We don't just want to tell them what to do, we want to tell them stuff like:
+ - why we are doing it
+ - what it's "for" (problem-solving, debugging, etc)
+ - how long they should spend on it, maximum
+ - how to get help
+ - how to review it with answers
+ - how to get it reviewed from mentors and peers
+ - type: input
+ attributes:
+ label: Link to the coursework
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Why are we doing this?
+ description: Clearly explain the purpose of this assignment
+ validations:
+ required: true
+ - type: input
+ attributes:
+ label: Maximum time in hours
+ description: (Tech has max 16 per week total)
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: How to get help
+ description: State simply how trainees can get help with this assignment
+ placeholder: |
+ Share your blockers in your class channel
+ https://syllabus.codeyourfuture.io/guides/asking-questions
+ - type: textarea
+ attributes:
+ label: How to submit
+ description: State in clear steps how a trainee can submit this assignment.
+ placeholder: |
+ Fork the repo to your own GitHub account
+ Make regular small commits with clear messages
+ When you are ready, open a Pull Request to the CYF repo
+ Make sure you fill in the PR template provided
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: How to review
+ description: How to get code review and how to self-review
+ - type: textarea
+ attributes:
+ label: Anything else?
+ description: |
+ Links? References? Anything that will give more context
+
+ Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
+ - type: markdown
+ attributes:
+ value: |
+ **Thank you so much.**
+
+ Please now complete this ticket by filling in the options on the sidebar.
+
+ 1. Update labels
+ - priority -- is this coursework key, mandatory, or stretch? Pick one.
+ - size -- help trainees plan their time with rough estimation. Pick one
+ - topics -- add all that seem relevant to you.
+ 2. Add to milestone
+ - week 1,2,3,4
+
+ Once your ticket is complete, you may like to add it to the example project board attached to this repo.
+ This is so you understand how trainees will use your work. Nobody has built a board copier yet, so trainees will be doing this step themselves.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
index 108898f0b..44b066ddb 100644
--- a/.github/pull_request_template.md
+++ b/.github/pull_request_template.md
@@ -1,32 +1,32 @@
-
-
-## 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](https://curriculum.codeyourfuture.io/guides/contributing/)
-- [ ] My changes meet the [requirements](./README.md) of this task
-
-## Changelist
-
-Briefly explain your PR.
-
-## Questions
-
-Ask any questions you have for your reviewer.
+
+
+## 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](https://curriculum.codeyourfuture.io/guides/contributing/)
+- [ ] My changes meet the [requirements](./README.md) of this task
+
+## Changelist
+
+Briefly explain your PR.
+
+## Questions
+
+Ask any questions you have for your reviewer.
diff --git a/.gitignore b/.gitignore
index bde36e530..946c065ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,4 @@
-node_modules
-.DS_Store
-.vscode
+node_modules
+.DS_Store
+.vscode
**/.DS_Store
\ No newline at end of file
diff --git a/.prettierrc b/.prettierrc
index 59bb3b44f..b0985c102 100644
--- a/.prettierrc
+++ b/.prettierrc
@@ -1,19 +1,19 @@
-{
- "arrowParens": "always",
- "bracketSpacing": true,
- "embeddedLanguageFormatting": "auto",
- "htmlWhitespaceSensitivity": "css",
- "insertPragma": false,
- "jsxBracketSameLine": false,
- "jsxSingleQuote": false,
- "printWidth": 80,
- "proseWrap": "preserve",
- "quoteProps": "as-needed",
- "requirePragma": false,
- "semi": true,
- "singleQuote": false,
- "tabWidth": 2,
- "trailingComma": "es5",
- "useTabs": false,
- "vueIndentScriptAndStyle": false
-}
+{
+ "arrowParens": "always",
+ "bracketSpacing": true,
+ "embeddedLanguageFormatting": "auto",
+ "htmlWhitespaceSensitivity": "css",
+ "insertPragma": false,
+ "jsxBracketSameLine": false,
+ "jsxSingleQuote": false,
+ "printWidth": 80,
+ "proseWrap": "preserve",
+ "quoteProps": "as-needed",
+ "requirePragma": false,
+ "semi": true,
+ "singleQuote": false,
+ "tabWidth": 2,
+ "trailingComma": "es5",
+ "useTabs": false,
+ "vueIndentScriptAndStyle": false
+}
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 2dd5a2432..58edcd042 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,11 +1,11 @@
-{
- "recommendations": [
- "esbenp.prettier-vscode",
- "dbaeumer.vscode-eslint",
- "streetsidesoftware.code-spell-checker",
- "eamodio.gitlens",
- "ritwickdey.LiveServer",
- "vsliveshare.vsliveshare",
- "Orta.vscode-jest"
- ]
-}
+{
+ "recommendations": [
+ "esbenp.prettier-vscode",
+ "dbaeumer.vscode-eslint",
+ "streetsidesoftware.code-spell-checker",
+ "eamodio.gitlens",
+ "ritwickdey.LiveServer",
+ "vsliveshare.vsliveshare",
+ "Orta.vscode-jest"
+ ]
+}
diff --git a/HOW_TO_REVIEW.md b/HOW_TO_REVIEW.md
index fd7820a13..0cc45cea7 100644
--- a/HOW_TO_REVIEW.md
+++ b/HOW_TO_REVIEW.md
@@ -1,52 +1,52 @@
-# Everyone reviews code at CYF
-
-https://curriculum.codeyourfuture.io/guides/reviewing/
-
-Mentors and trainees all review code, and collaborate on improving code quality. We are all helping each other to talk, write, and think about code more clearly.
-
-We are not reviewing code as if we were to merge this PR into production; we are opening a technical conversation for the purpose of insight and development.
-
-## Key points:
-
-1. Ask questions instead of making statements:
-
- **YES:** "Is there another element you could use to group a set of fields in a form? Why might someone use a different element in a form?"
- **NO:** "Use fieldset not divs"
-
-2. Encourage simplicity, clarity, and precision:
-
- **YES** "There are 15,0000 files in this changelist. Which files should be reviewed?"
- **NO** "It doesn't matter; I can try to figure out what you meant."
-
-3. Respect everyone's work and time:
-
- **YES** "I think there's some more to do here. Thanks for sharing where you're up to."
- **NO** "This is rubbish. Try harder."
-
-## Labels
-
-Reviewers, please add labels (provided) to the PR once you've reviewed. This helps to focus the trainee on the areas they should work on, and gives an overview for mentors on what the whole cohort needs to work on.
-
-## Solutions
-
-### Where to find solutions?
-
-You can find the solutions for the module on the `solutions` branch.
-
-### Solutions branch
-
-The solutions branch typically contains:
-
-#### Sample solutions
-
-Solutions are example answers not the only correct answers.
-
-#### Common responses guides.
-
-Everyone is invited to contribute commonly encountered problems, mistakes, misunderstandings, and mental-model errors to our common responses documents.
-
-Use these resources to inform your code review, get unstuck, and improve your understanding.
-
-## Guides
-
-https://curriculum.codeyourfuture.io/guides/reviewing/
+# Everyone reviews code at CYF
+
+https://curriculum.codeyourfuture.io/guides/reviewing/
+
+Mentors and trainees all review code, and collaborate on improving code quality. We are all helping each other to talk, write, and think about code more clearly.
+
+We are not reviewing code as if we were to merge this PR into production; we are opening a technical conversation for the purpose of insight and development.
+
+## Key points:
+
+1. Ask questions instead of making statements:
+
+ **YES:** "Is there another element you could use to group a set of fields in a form? Why might someone use a different element in a form?"
+ **NO:** "Use fieldset not divs"
+
+2. Encourage simplicity, clarity, and precision:
+
+ **YES** "There are 15,0000 files in this changelist. Which files should be reviewed?"
+ **NO** "It doesn't matter; I can try to figure out what you meant."
+
+3. Respect everyone's work and time:
+
+ **YES** "I think there's some more to do here. Thanks for sharing where you're up to."
+ **NO** "This is rubbish. Try harder."
+
+## Labels
+
+Reviewers, please add labels (provided) to the PR once you've reviewed. This helps to focus the trainee on the areas they should work on, and gives an overview for mentors on what the whole cohort needs to work on.
+
+## Solutions
+
+### Where to find solutions?
+
+You can find the solutions for the module on the `solutions` branch.
+
+### Solutions branch
+
+The solutions branch typically contains:
+
+#### Sample solutions
+
+Solutions are example answers not the only correct answers.
+
+#### Common responses guides.
+
+Everyone is invited to contribute commonly encountered problems, mistakes, misunderstandings, and mental-model errors to our common responses documents.
+
+Use these resources to inform your code review, get unstuck, and improve your understanding.
+
+## Guides
+
+https://curriculum.codeyourfuture.io/guides/reviewing/
diff --git a/Sprint-1/1-key-exercises/1-count.js b/Sprint-1/1-key-exercises/1-count.js
index 117bcb2b6..b2f1dab59 100644
--- a/Sprint-1/1-key-exercises/1-count.js
+++ b/Sprint-1/1-key-exercises/1-count.js
@@ -1,6 +1,7 @@
-let count = 0;
-
-count = count + 1;
-
-// 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
+let count = 0;
+
+count = count + 1;
+
+// 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
+//line 3 is assigning the count variable with a new value obtained by adding 1 to count.
diff --git a/Sprint-1/1-key-exercises/2-initials.js b/Sprint-1/1-key-exercises/2-initials.js
index 47561f617..33cc38ed7 100644
--- a/Sprint-1/1-key-exercises/2-initials.js
+++ b/Sprint-1/1-key-exercises/2-initials.js
@@ -1,11 +1,12 @@
-let firstName = "Creola";
-let middleName = "Katherine";
-let lastName = "Johnson";
-
-// Declare a variable called initials that stores the first character of each string.
-// 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 = ``;
-
-// https://www.google.com/search?q=get+first+character+of+string+mdn
-
+let firstName = "Creola";
+let middleName = "Katherine";
+let lastName = "Johnson";
+
+// Declare a variable called initials that stores the first character of each string.
+// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
+//we want to use a method that takes a string variable and returns the first letter of that string.
+let initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)}`;
+console.log(initials);
+
+// https://www.google.com/search?q=get+first+character+of+string+mdn
+
diff --git a/Sprint-1/1-key-exercises/3-paths.js b/Sprint-1/1-key-exercises/3-paths.js
index ab90ebb28..96791bb89 100644
--- a/Sprint-1/1-key-exercises/3-paths.js
+++ b/Sprint-1/1-key-exercises/3-paths.js
@@ -1,23 +1,27 @@
-// The diagram below shows the different names for parts of a file path on a Unix operating system
-
-// ┌─────────────────────┬────────────┐
-// │ dir │ base │
-// ├──────┬ ├──────┬─────┤
-// │ root │ │ name │ ext │
-// " / home/user/dir / file .txt "
-// └──────┴──────────────┴──────┴─────┘
-
-// (All spaces in the "" line should be ignored. They are purely for formatting.)
-
-const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt";
-const lastSlashIndex = filePath.lastIndexOf("/");
-const base = filePath.slice(lastSlashIndex + 1);
-console.log(`The base part of ${filePath} is ${base}`);
-
-// Create a variable to store the dir part of the filePath variable
-// Create a variable to store the ext part of the variable
-
-const dir = ;
-const ext = ;
-
+// The diagram below shows the different names for parts of a file path on a Unix operating system
+
+// ┌─────────────────────┬────────────┐
+// │ dir │ base │
+// ├──────┬ ├──────┬─────┤
+// │ root │ │ name │ ext │
+// " / home/user/dir / file .txt "
+// └──────┴──────────────┴──────┴─────┘
+
+// (All spaces in the "" line should be ignored. They are purely for formatting.)
+
+const filePath = "/Users/mitch/cyf/Module-JS1/week-1/interpret/file.txt";
+const lastSlashIndex = filePath.lastIndexOf("/");
+const base = filePath.slice(lastSlashIndex + 1);
+console.log(`The base part of ${filePath} is ${base}`);
+
+// Create a variable to store the dir part of the filePath variable
+// Create a variable to store the ext part of the variable
+
+const dir = filePath.slice(0, lastSlashIndex);
+console.log(`The dir part of ${filePath} is ${dir}`);
+
+const extIndex = filePath.lastIndexOf(".");
+const ext = filePath.slice(extIndex + 1);
+console.log(`The ext part of ${filePath} is ${ext}`);
+
// https://www.google.com/search?q=slice+mdn
\ No newline at end of file
diff --git a/Sprint-1/1-key-exercises/4-random.js b/Sprint-1/1-key-exercises/4-random.js
index 292f83aab..7d32113a6 100644
--- a/Sprint-1/1-key-exercises/4-random.js
+++ b/Sprint-1/1-key-exercises/4-random.js
@@ -1,9 +1,13 @@
-const minimum = 1;
-const maximum = 100;
-
-const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
-
-// 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
-// Try logging the value of num and running the program several times to build an idea of what the program is doing
+const minimum = 1;
+const maximum = 100;
+
+const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
+
+console.log(num);
+
+// In this exercise, you will need to work out what num represents?
+//num is going to be a random number between 1 and 100 inclusive of 100.
+// Try breaking down the expression and using documentation to explain what it means
+//math.random() will generate a random number between 0 and 1 excluding 1, this will be multiplied by the result of the difference between maximum and minimum plus 1 giving 100. we will apply the math.floor function to round down the result to the nearest integer, which gives us a number between 0 and 99. Finally, we will add the minimum value to the result, which will give us a random number between 1 and 100 inclusive of 100.
+// It will help to think about the order in which expressions are evaluated
+// Try logging the value of num and running the program several times to build an idea of what the program is doing
diff --git a/Sprint-1/2-mandatory-errors/0.js b/Sprint-1/2-mandatory-errors/0.js
index cf6c5039f..ef521819a 100644
--- a/Sprint-1/2-mandatory-errors/0.js
+++ b/Sprint-1/2-mandatory-errors/0.js
@@ -1,2 +1,2 @@
-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?
\ No newline at end of file
+//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?
\ No newline at end of file
diff --git a/Sprint-1/2-mandatory-errors/1.js b/Sprint-1/2-mandatory-errors/1.js
index 7a43cbea7..b79c44249 100644
--- a/Sprint-1/2-mandatory-errors/1.js
+++ b/Sprint-1/2-mandatory-errors/1.js
@@ -1,4 +1,5 @@
-// trying to create an age variable and then reassign the value by 1
-
-const age = 33;
-age = age + 1;
+// trying to create an age variable and then reassign the value by 1
+
+let age = 33; //we can use let instead of const if we want to reassign the value later
+age = age + 1;
+console.log(age); // this will log the value of age to the console
\ No newline at end of file
diff --git a/Sprint-1/2-mandatory-errors/2.js b/Sprint-1/2-mandatory-errors/2.js
index e09b89831..e79c7476e 100644
--- a/Sprint-1/2-mandatory-errors/2.js
+++ b/Sprint-1/2-mandatory-errors/2.js
@@ -1,5 +1,5 @@
-// Currently trying to print the string "I was born in Bolton" but it isn't working...
-// what's the error ?
-
-console.log(`I was born in ${cityOfBirth}`);
-const cityOfBirth = "Bolton";
+// Currently trying to print the string "I was born in Bolton" but it isn't working...
+// what's the error ?
+
+console.log(`I was born in ${cityOfBirth}`); //we cannot access cityOfBirth before it is defined, so we should move line 5 to line 3.
+const cityOfBirth = "Bolton";
diff --git a/Sprint-1/2-mandatory-errors/3.js b/Sprint-1/2-mandatory-errors/3.js
index ec101884d..1d698bb87 100644
--- a/Sprint-1/2-mandatory-errors/3.js
+++ b/Sprint-1/2-mandatory-errors/3.js
@@ -1,9 +1,11 @@
-const cardNumber = 4533787178994213;
-const last4Digits = cardNumber.slice(-4);
-
-// The last4Digits variable should store the last 4 digits of cardNumber
-// However, the code isn't working
-// Before running the code, make and explain a prediction about why the code won't work
-// Then run the code and see what error it gives.
-// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
-// Then try updating the expression last4Digits is assigned to, in order to get the correct value
+const cardNumber = "4533787178994213";
+const last4Digits = cardNumber.slice(-4);
+console.log(last4Digits);
+
+// The last4Digits variable should store the last 4 digits of cardNumber
+// However, the code isn't working
+// Before running the code, make and explain a prediction about why the code won't work
+//I predict that the code will work and should return the last 4 digits
+// Then run the code and see what error it gives.
+// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
+// Then try updating the expression last4Digits is assigned to, in order to get the correct value
diff --git a/Sprint-1/2-mandatory-errors/4.js b/Sprint-1/2-mandatory-errors/4.js
index 21dad8c5d..129eb2693 100644
--- a/Sprint-1/2-mandatory-errors/4.js
+++ b/Sprint-1/2-mandatory-errors/4.js
@@ -1,2 +1,5 @@
-const 12HourClockTime = "20:53";
-const 24hourClockTime = "08:53";
\ No newline at end of file
+const 12HourClockTime = "20:53"; //js does nott allow variable names to start with a number
+const 24hourClockTime = "08:53"; //it is better to use the number in the middle or at the end of the variable name.
+//example:
+const clockTime12Hour = "20:53"; //this is a valid variable name
+const clockTime24Hour = "08:53"; //this is also a valid variable name
\ No newline at end of file
diff --git a/Sprint-1/3-mandatory-interpret/1-percentage-change.js b/Sprint-1/3-mandatory-interpret/1-percentage-change.js
index e24ecb8e1..543f59252 100644
--- a/Sprint-1/3-mandatory-interpret/1-percentage-change.js
+++ b/Sprint-1/3-mandatory-interpret/1-percentage-change.js
@@ -1,22 +1,27 @@
-let carPrice = "10,000";
-let priceAfterOneYear = "8,543";
-
-carPrice = Number(carPrice.replaceAll(",", ""));
-priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
-
-const priceDifference = carPrice - priceAfterOneYear;
-const percentageChange = (priceDifference / carPrice) * 100;
-
-console.log(`The percentage change is ${percentageChange}`);
-
-// Read the code and then answer the questions below
-
-// a) How many function calls are there in this file? Write down all the lines where a function call is made
-
-// 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?
-
-// c) Identify all the lines that are variable reassignment statements
-
-// d) Identify all the lines that are variable declarations
-
-// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
+let carPrice = "10,000";
+let priceAfterOneYear = "8,543";
+
+carPrice = Number(carPrice.replaceAll(",", ""));
+priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ,""));
+
+const priceDifference = carPrice - priceAfterOneYear;
+const percentageChange = (priceDifference / carPrice) * 100;
+
+console.log(`The percentage change is ${percentageChange}`);
+
+// Read the code and then answer the questions below
+
+// a) How many function calls are there in this file? Write down all the lines where a function call is made there are 4 function calls in total.
+// Function calls: line 4 has a Number method call which converts a given value to a number if possible.
+//line 4 also has a replaceAll method call which replaces all occurrences of a specified substring with another given substring.
+// Line 5 has a Number method call which converts a given value to a number if possible.
+// Line 5 also has a replaceAll method call which replaces all occurrences of a specified substring with another given substring.
+
+// 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 because there is a missing comma in the replaceAll method call on line 5. this separates the first argument from the second argument.
+// this can be fixed by adding a comma between the two arguments in the replaceAll method call on line 5.
+
+// c) Identify all the lines that are variable reassignment statements, line 4 and 5
+
+// d) Identify all the lines that are variable declarations, lines 1,2,7,8.
+
+// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression? this expression is converting the the string value of of carPrice into a number by first removing all the commas in the string to ensure it is in a format that can be converted to a number.
diff --git a/Sprint-1/3-mandatory-interpret/2-time-format.js b/Sprint-1/3-mandatory-interpret/2-time-format.js
index 47d239558..074718fa1 100644
--- a/Sprint-1/3-mandatory-interpret/2-time-format.js
+++ b/Sprint-1/3-mandatory-interpret/2-time-format.js
@@ -1,25 +1,26 @@
-const movieLength = 8784; // length of movie in seconds
-
-const remainingSeconds = movieLength % 60;
-const totalMinutes = (movieLength - remainingSeconds) / 60;
-
-const remainingMinutes = totalMinutes % 60;
-const totalHours = (totalMinutes - remainingMinutes) / 60;
-
-const result = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
-console.log(result);
-
-// For the piece of code above, read the code and then answer the following questions
-
-// a) How many variable declarations are there in this program?
-
-// b) How many function calls are there?
-
-// c) Using documentation, explain what the expression movieLength % 60 represents
-// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
-
-// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
-
-// e) What do you think the variable result represents? Can you think of a better name for this variable?
-
-// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
+const movieLength = 586.8650; // length of movie in seconds
+
+const remainingSeconds = movieLength % 60;
+const totalMinutes = (movieLength - remainingSeconds) / 60;
+
+const remainingMinutes = totalMinutes % 60;
+const totalHours = (totalMinutes - remainingMinutes) / 60;
+
+const result = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
+console.log(result);
+
+// For the piece of code above, read the code and then answer the following questions
+
+// a) How many variable declarations are there in this program? there are 6 variable declarations in this program: movieLength, remainingSeconds, totalMinutes, remainingMinutes, totalHours, and result.
+
+// b) How many function calls are there? there is 1 function call in this program: the console.log() function call on line 10.
+
+// c) Using documentation, explain what the expression movieLength % 60 represents
+// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators
+//this expression returns the remainder of the division of movielength by 60. It is used to calculate the remaining seconds after converting the total movie length from seconds to minutes.
+
+// d) Interpret line 4, what does the expression assigned to totalMinutes mean? it gives us the total number of minutes in the movie.
+
+// e) What do you think the variable result represents? Can you think of a better name for this variable? it represents the total length of the movie in the format of hours:minutes:seconds. A better name for this variable could be movieDuration.
+
+// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer it seems to work for all values of movieLength, as it calculates the total hours, minutes, and seconds based on the given movie length in seconds even when given floating point numbers.
diff --git a/Sprint-1/3-mandatory-interpret/3-to-pounds.js b/Sprint-1/3-mandatory-interpret/3-to-pounds.js
index 60c9ace69..7da373a91 100644
--- a/Sprint-1/3-mandatory-interpret/3-to-pounds.js
+++ b/Sprint-1/3-mandatory-interpret/3-to-pounds.js
@@ -1,27 +1,32 @@
-const penceString = "399p";
-
-const penceStringWithoutTrailingP = penceString.substring(
- 0,
- penceString.length - 1
-);
-
-const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
-const pounds = paddedPenceNumberString.substring(
- 0,
- paddedPenceNumberString.length - 2
-);
-
-const pence = paddedPenceNumberString
- .substring(paddedPenceNumberString.length - 2)
- .padEnd(2, "0");
-
-console.log(`£${pounds}.${pence}`);
-
-// This program takes a string representing a price in pence
-// The program then builds up a string representing the price in pounds
-
-// You need to do a step-by-step breakdown of each line in this program
-// Try and describe the purpose / rationale behind each step
-
-// To begin, we can start with
-// 1. const penceString = "399p": initialises a string variable with the value "399p"
+const penceString = "399p";
+
+const penceStringWithoutTrailingP = penceString.substring(
+ 0,
+ penceString.length - 1
+);
+
+const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
+const pounds = paddedPenceNumberString.substring(
+ 0,
+ paddedPenceNumberString.length - 2
+);
+
+const pence = paddedPenceNumberString
+ .substring(paddedPenceNumberString.length - 2)
+ .padEnd(2, "0");
+
+console.log(`£${pounds}.${pence}`);
+
+// This program takes a string representing a price in pence
+// The program then builds up a string representing the price in pounds
+
+// You need to do a step-by-step breakdown of each line in this program
+// Try and describe the purpose / rationale behind each step
+
+// To begin, we can start with
+// 1. const penceString = "399p": initialises a string variable with the value "399p"
+// 2. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1): removes the trailing 'p' from the string by using the substring method and passing it the start index (0) and the end index (length - 1) returning "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" remaining unchanged.
+// 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(paddedPenceNumberString.length - 2).padEnd(2, "0"): extracts the last two characters of the string and pads it with trailing zeros if necessary, resulting in "99" since it already has two characters.
+// 6. console.log(`£${pounds}.${pence}`): prints the final formatted string in pounds and pence, resulting in "£3.99". by concatenating the pounds and pence variables with a '£' symbol and a '.' in between.
diff --git a/Sprint-1/4-stretch-explore/chrome.md b/Sprint-1/4-stretch-explore/chrome.md
index e7dd5feaf..95bf1ed77 100644
--- a/Sprint-1/4-stretch-explore/chrome.md
+++ b/Sprint-1/4-stretch-explore/chrome.md
@@ -1,18 +1,21 @@
-Open a new window in Chrome,
-
-then locate the **Console** tab.
-
-Voila! You now have access to the [Chrome V8 Engine](https://www.cloudflare.com/en-gb/learning/serverless/glossary/what-is-chrome-v8/).
-Just like the Node REPL, you can input JavaScript code into the Console tab and the V8 engine will execute it.
-
-Let's try an example.
-
-In the Chrome console,
-invoke the function `alert` with an input string of `"Hello world!"`;
-
-What effect does calling the `alert` function have?
-
-Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`.
-
-What effect does calling the `prompt` function have?
-What is the return value of `prompt`?
+Open a new window in Chrome,
+
+then locate the **Console** tab.
+
+Voila! You now have access to the [Chrome V8 Engine](https://www.cloudflare.com/en-gb/learning/serverless/glossary/what-is-chrome-v8/).
+Just like the Node REPL, you can input JavaScript code into the Console tab and the V8 engine will execute it.
+
+Let's try an example.
+
+In the Chrome console,
+invoke the function `alert` with an input string of `"Hello world!"`;
+
+What effect does calling the `alert` function have?
+it produces a pop up with the string that was passed to the alert function.
+
+Now try invoking the function `prompt` with a string input of `"What is your name?"` - store the return value of your call to `prompt` in an variable called `myName`.
+
+What effect does calling the `prompt` function have?
+the prompt function produces a pop up box with an input box so a user can type in information.
+What is the return value of `prompt`?
+it returns the value from the user input.
\ No newline at end of file
diff --git a/Sprint-1/4-stretch-explore/objects.md b/Sprint-1/4-stretch-explore/objects.md
index 0216dee56..6b5357ade 100644
--- a/Sprint-1/4-stretch-explore/objects.md
+++ b/Sprint-1/4-stretch-explore/objects.md
@@ -1,16 +1,17 @@
-## Objects
-
-In this activity, we'll explore some additional concepts that you'll encounter in more depth later on in the course.
-
-Open the Chrome devtools Console, type in `console.log` and then hit enter
-
-What output do you get?
-
-Now enter just `console` in the Console, what output do you get back?
-
-Try also entering `typeof console`
-
-Answer the following questions:
-
-What does `console` store?
-What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
+## Objects
+
+In this activity, we'll explore some additional concepts that you'll encounter in more depth later on in the course.
+
+Open the Chrome devtools Console, type in `console.log` and then hit enter
+
+What output do you get? we get the outline of the function for console.log
+
+Now enter just `console` in the Console, what output do you get back? we get the console object and can view all its properties or methods associated with it.
+
+Try also entering `typeof console`
+
+Answer the following questions:
+
+What does `console` store? console is an object that stores functions
+What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
+the `.` is a way of accessing the properties of the console object, which in the case of console.log is the log function and in the case of console.assert its the assert function.
diff --git a/Sprint-1/readme.md b/Sprint-1/readme.md
index 62d24c958..7227cdeb1 100644
--- a/Sprint-1/readme.md
+++ b/Sprint-1/readme.md
@@ -1,35 +1,35 @@
-# 🧭 Guide to Week 1 exercises
-
-> https://programming.codeyourfuture.io/structuring-data/sprints/1/prep/
-
-> [!TIP]
-> You should always do the prep work _before_ attempting the coursework.
-> The prep shows you _how_ to do the coursework.
-> There is often a step by step video you can code along with too.
-> Do the prep.
-
-This README will guide you through the different sections for this week.
-
-## 1 Exercises
-
-In this section, you'll have a short program and task. Some of the syntax may be unfamiliar - in this case, you'll need to look things up in documentation.
-
-https://developer.mozilla.org/en-US/docs/Web/JavaScript
-
-## 2 Errors
-
-In this section, you'll need to go to each file in `errors` directory and run the file with node to check what the error is. Your task is to interpret the error message and explain why it occurs. The [errors documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors) will help you figure out the solution.
-
-## 3 Interpret
-
-In these tasks, you have to interpret a slightly larger program with some syntax / operators / functions that may be unfamiliar.
-
-You must use documentation to make sense of anything unfamiliar - learning how to look things up this way is a fundamental part of being a developer!
-
-You can also use `console.log` to check the value of different variables in the code.
-
-https://developer.mozilla.org/en-US/docs/Web/JavaScript
-
-## 4 Explore - Stretch 💪
-
-This stretch activity will get you to start exploring new concepts and environments by yourself. It will do so by prompting you to reflect on some questions.
+# 🧭 Guide to Week 1 exercises
+
+> https://programming.codeyourfuture.io/structuring-data/sprints/1/prep/
+
+> [!TIP]
+> You should always do the prep work _before_ attempting the coursework.
+> The prep shows you _how_ to do the coursework.
+> There is often a step by step video you can code along with too.
+> Do the prep.
+
+This README will guide you through the different sections for this week.
+
+## 1 Exercises
+
+In this section, you'll have a short program and task. Some of the syntax may be unfamiliar - in this case, you'll need to look things up in documentation.
+
+https://developer.mozilla.org/en-US/docs/Web/JavaScript
+
+## 2 Errors
+
+In this section, you'll need to go to each file in `errors` directory and run the file with node to check what the error is. Your task is to interpret the error message and explain why it occurs. The [errors documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors) will help you figure out the solution.
+
+## 3 Interpret
+
+In these tasks, you have to interpret a slightly larger program with some syntax / operators / functions that may be unfamiliar.
+
+You must use documentation to make sense of anything unfamiliar - learning how to look things up this way is a fundamental part of being a developer!
+
+You can also use `console.log` to check the value of different variables in the code.
+
+https://developer.mozilla.org/en-US/docs/Web/JavaScript
+
+## 4 Explore - Stretch 💪
+
+This stretch activity will get you to start exploring new concepts and environments by yourself. It will do so by prompting you to reflect on some questions.
diff --git a/Sprint-2/1-key-errors/0.js b/Sprint-2/1-key-errors/0.js
index 653d6f5a0..32eb9e723 100644
--- a/Sprint-2/1-key-errors/0.js
+++ b/Sprint-2/1-key-errors/0.js
@@ -1,13 +1,22 @@
-// Predict and explain first...
-// =============> write your prediction here
-
-// call the function capitalise with a string input
-// interpret the error message and figure out why an error is occurring
-
-function capitalise(str) {
- let str = `${str[0].toUpperCase()}${str.slice(1)}`;
- return str;
-}
-
-// =============> write your explanation here
-// =============> write your new code here
+// Predict and explain first...
+// =============> write your prediction here
+//I think the code will throw an error because the variable `str` is being declared twice using `let`, which is not allowed in JavaScript. The first declaration is in the function parameter, and the second one is inside the function body.
+
+// call the function capitalise with a string input
+// interpret the error message and figure out why an error is occurring
+//the funct
+
+function capitalise(str) {
+ let str = `${str[0].toUpperCase()}${str.slice(1)}`;
+ return str;
+}
+
+capitalise("hello");
+
+// =============> write your explanation here
+// The error occurs because the variable `str` is declared twice using `let` in the same scope. In JavaScript, you cannot redeclare a variable with `let` in the same block scope. The first declaration is as a function parameter, and the second one is inside the function body, which causes a syntax error.
+// =============> write your new code here
+function capitalise(str) {
+ str = `${str[0].toUpperCase()}${str.slice(1)}`;
+ return str;
+}
diff --git a/Sprint-2/1-key-errors/1.js b/Sprint-2/1-key-errors/1.js
index f2d56151f..d035c41f0 100644
--- a/Sprint-2/1-key-errors/1.js
+++ b/Sprint-2/1-key-errors/1.js
@@ -1,20 +1,32 @@
-// Predict and explain first...
-
-// Why will an error occur when this program runs?
-// =============> write your prediction here
-
-// Try playing computer with the example to work out what is going on
-
-function convertToPercentage(decimalNumber) {
- const decimalNumber = 0.5;
- const percentage = `${decimalNumber * 100}%`;
-
- return percentage;
-}
-
-console.log(decimalNumber);
-
-// =============> write your explanation here
-
-// Finally, correct the code to fix the problem
-// =============> write your new code here
+// Predict and explain first...
+
+// Why will an error occur when this program runs?
+// =============> write your prediction here
+//an error will occur because the variable `decimalNumber` is declared twice in the same scope, which is not allowed in JavaScript. The first declaration is as a function parameter, and the second one is inside the function body. the code will throw a syntax error.
+//the console log will not work because the variable `decimalNumber` is not defined in the global scope, it is only defined within the function `convertToPercentage`.
+
+// Try playing computer with the example to work out what is going on
+
+function convertToPercentage(decimalNumber) {
+ const decimalNumber = 0.5;
+ const percentage = `${decimalNumber * 100}%`;
+
+ return percentage;
+}
+
+console.log(decimalNumber);
+
+// =============> write your explanation here
+//we received a syntax error for declaring an identifier which had alread been declared as a parameter.
+//we also received a reference error because the variable `decimalNumber` was not defined in the global scope, it was only defined within the function `convertToPercentage`.
+
+// Finally, correct the code to fix the problem
+// =============> write your new code here
+function convertToPercentage() {
+ const decimalNumber = 0.5;
+ const percentage = `${decimalNumber * 100}%`;
+
+ return percentage;
+}
+
+console.log(convertToPercentage());
diff --git a/Sprint-2/1-key-errors/2.js b/Sprint-2/1-key-errors/2.js
index aad57f7cf..6cdf1312c 100644
--- a/Sprint-2/1-key-errors/2.js
+++ b/Sprint-2/1-key-errors/2.js
@@ -1,20 +1,24 @@
-
-// Predict and explain first BEFORE you run any code...
-
-// this function should square any number but instead we're going to get an error
-
-// =============> write your prediction of the error here
-
-function square(3) {
- return num * num;
-}
-
-// =============> write the error message here
-
-// =============> explain this error message here
-
-// Finally, correct the code to fix the problem
-
-// =============> write your new code here
-
-
+
+// Predict and explain first BEFORE you run any code...
+
+// this function should square any number but instead we're going to get an error
+
+// =============> write your prediction of the error here
+//we cannot pass a value to a function that is not defined as a parameter. The function `square` is trying to use the variable `num` which is not defined anywhere in the code. This will result in a ReferenceError.
+
+function square(3) {
+ return num * num;
+}
+
+// =============> write the error message here
+//syntax error: Unexpected number
+
+// =============> explain this error message here
+//the error occurs because the function was defined with a number instead of a parameter name. In JavaScript, function parameters must be valid variable names. a number cannot be used as a parameter name.
+// Finally, correct the code to fix the problem
+
+// =============> write your new code here
+function square(num) {
+ return num * num;
+}
+
diff --git a/Sprint-2/2-mandatory-debug/0.js b/Sprint-2/2-mandatory-debug/0.js
index b27511b41..21d83a0ce 100644
--- a/Sprint-2/2-mandatory-debug/0.js
+++ b/Sprint-2/2-mandatory-debug/0.js
@@ -1,14 +1,16 @@
-// Predict and explain first...
-
-// =============> write your prediction here
-
-function multiply(a, b) {
- console.log(a * b);
-}
-
-console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
-
-// =============> write your explanation here
-
-// Finally, correct the code to fix the problem
-// =============> write your new code here
+// Predict and explain first...
+
+// =============> write your prediction here
+//the function will log the result of multiplying 10 and 32, but it does not return a value from the multiply function, so the output from the placeholder will be undefined.
+
+function multiply(a, b) {
+ return (a * b);
+}
+
+console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);
+
+// =============> write your explanation here
+//the function logged the result of 32 *10 on one line and on the next line it logged the string "The result of multiplying 10 and 32 is undefined" because the multiply function does not return a value.
+
+// Finally, correct the code to fix the problem
+// =============> write your new code here
diff --git a/Sprint-2/2-mandatory-debug/1.js b/Sprint-2/2-mandatory-debug/1.js
index 37cedfbcf..d765a779c 100644
--- a/Sprint-2/2-mandatory-debug/1.js
+++ b/Sprint-2/2-mandatory-debug/1.js
@@ -1,13 +1,21 @@
-// Predict and explain first...
-// =============> write your prediction here
-
-function sum(a, b) {
- return;
- a + b;
-}
-
-console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
-
-// =============> write your explanation here
-// Finally, correct the code to fix the problem
-// =============> write your new code here
+// Predict and explain first...
+// =============> write your prediction here
+//the function sum terminates at the return statement but does not return anything so it will return undefined the line after return is not executed.
+//the console log will output "The sum of 10 and 32 is undefined".
+
+function sum(a, b) {
+ return;
+ a + b;
+}
+
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
+
+// =============> write your explanation here
+//the console logged "The sum of 10 and 32 is undefined". this is because the function sum does not return any value. The return statement is followed by a semicolon, which means the function exits at that point without executing the line that adds a and b together. Therefore, the function returns undefined.
+// Finally, correct the code to fix the problem
+// =============> write your new code here
+function sum(a, b) {
+ return a + b;
+}
+
+console.log(`The sum of 10 and 32 is ${sum(10, 32)}`);
diff --git a/Sprint-2/2-mandatory-debug/2.js b/Sprint-2/2-mandatory-debug/2.js
index 57d3f5dc3..850ec8f54 100644
--- a/Sprint-2/2-mandatory-debug/2.js
+++ b/Sprint-2/2-mandatory-debug/2.js
@@ -1,24 +1,31 @@
-// Predict and explain first...
-
-// Predict the output of the following code:
-// =============> Write your prediction here
-
-const num = 103;
-
-function getLastDigit() {
- return num.toString().slice(-1);
-}
-
-console.log(`The last digit of 42 is ${getLastDigit(42)}`);
-console.log(`The last digit of 105 is ${getLastDigit(105)}`);
-console.log(`The last digit of 806 is ${getLastDigit(806)}`);
-
-// Now run the code and compare the output to your prediction
-// =============> write the output here
-// Explain why the output is the way it is
-// =============> write your explanation here
-// Finally, correct the code to fix the problem
-// =============> write your new code here
-
-// This program should tell the user the last digit of each number.
-// Explain why getLastDigit is not working properly - correct the problem
+// Predict and explain first...
+
+// Predict the output of the following code:
+// =============> Write your prediction here
+//the first log will output "The last digit of 42 is 3" this is because the function getLastDigit does not take a parameter and uses a hardcoded value of 103. so it will return the last digit of 103 which is 3.
+//the second log will output "The last digit of 105 is 3" this is because the function getLastDigit does not take a parameter and uses a hardcoded value of 103. so it will return the last digit of 103 which is 3.
+//the third log will output "The last digit of 806 is 3" this is because the function getLastDigit does not take a parameter and uses a hardcoded value of 103. so it will return the last digit of 103 which is 3.
+
+
+// Now run the code and compare the output to your prediction
+// =============> write the output here
+//The last digit of 42 is 3
+//The last digit of 105 is 3
+//The last digit of 806 is 3
+// Explain why the output is the way it is
+// =============> write your explanation here
+// The output is the way it is because the function getLastDigit does not take any parameters. It always returns the last digit of the hardcoded number 103, which is 3. Regardless of the input provided in the console.log statements, the output will always be 3.
+// Finally, correct the code to fix the problem
+// =============> write your new code here
+
+function getLastDigit(num) {
+ return num.toString().slice(-1);
+}
+
+console.log(`The last digit of 42 is ${getLastDigit(42)}`);
+console.log(`The last digit of 105 is ${getLastDigit(105)}`);
+console.log(`The last digit of 806 is ${getLastDigit(806)}`);
+
+
+// This program should tell the user the last digit of each number.
+// Explain why getLastDigit is not working properly - correct the problem
diff --git a/Sprint-2/3-mandatory-implement/1-bmi.js b/Sprint-2/3-mandatory-implement/1-bmi.js
index 17b1cbde1..e875710f6 100644
--- a/Sprint-2/3-mandatory-implement/1-bmi.js
+++ b/Sprint-2/3-mandatory-implement/1-bmi.js
@@ -1,19 +1,22 @@
-// Below are the steps for how BMI is calculated
-
-// The BMI calculation divides an adult's weight in kilograms (kg) by their height in metres (m) squared.
-
-// For example, if you weigh 70kg (around 11 stone) and are 1.73m (around 5 feet 8 inches) tall, you work out your BMI by:
-
-// squaring your height: 1.73 x 1.73 = 2.99
-// dividing 70 by 2.99 = 23.41
-// Your result will be displayed to 1 decimal place, for example 23.4.
-
-// You will need to implement a function that calculates the BMI of someone based off their weight and height
-
-// Given someone's weight in kg and height in metres
-// Then when we call this function with the weight and height
-// It should return their Body Mass Index to 1 decimal place
-
-function calculateBMI(weight, height) {
- // return the BMI of someone based off their weight and height
-}
\ No newline at end of file
+// Below are the steps for how BMI is calculated
+
+// The BMI calculation divides an adult's weight in kilograms (kg) by their height in metres (m) squared.
+
+// For example, if you weigh 70kg (around 11 stone) and are 1.73m (around 5 feet 8 inches) tall, you work out your BMI by:
+
+// squaring your height: 1.73 x 1.73 = 2.99
+// dividing 70 by 2.99 = 23.41
+// Your result will be displayed to 1 decimal place, for example 23.4.
+
+// You will need to implement a function that calculates the BMI of someone based off their weight and height
+
+// Given someone's weight in kg and height in metres
+// Then when we call this function with the weight and height
+// It should return their Body Mass Index to 1 decimal place
+
+function calculateBMI(weight, height) {
+ // return the BMI of someone based off their weight and height
+ return ((weight / (height * height)).toFixed(1));
+}
+
+console.log(calculateBMI(70, 1.73)); // Example usage
\ No newline at end of file
diff --git a/Sprint-2/3-mandatory-implement/2-cases.js b/Sprint-2/3-mandatory-implement/2-cases.js
index 5b0ef77ad..82ded4bf6 100644
--- a/Sprint-2/3-mandatory-implement/2-cases.js
+++ b/Sprint-2/3-mandatory-implement/2-cases.js
@@ -1,16 +1,22 @@
-// A set of words can be grouped together in different cases.
-
-// For example, "hello there" in snake case would be written "hello_there"
-// UPPER_SNAKE_CASE means taking a string and writing it in all caps with underscores instead of spaces.
-
-// Implement a function that:
-
-// Given a string input like "hello there"
-// When we call this function with the input string
-// it returns the string in UPPER_SNAKE_CASE, so "HELLO_THERE"
-
-// Another example: "lord of the rings" should be "LORD_OF_THE_RINGS"
-
-// You will need to come up with an appropriate name for the function
-// Use the MDN string documentation to help you find a solution
-// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
+// A set of words can be grouped together in different cases.
+
+// For example, "hello there" in snake case would be written "hello_there"
+// UPPER_SNAKE_CASE means taking a string and writing it in all caps with underscores instead of spaces.
+
+// Implement a function that:
+
+// Given a string input like "hello there"
+// When we call this function with the input string
+// it returns the string in UPPER_SNAKE_CASE, so "HELLO_THERE"
+
+// Another example: "lord of the rings" should be "LORD_OF_THE_RINGS"
+
+// You will need to come up with an appropriate name for the function
+// Use the MDN string documentation to help you find a solution
+// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
+
+function toUpperSnakeCase(inputString){
+ return inputString.replaceAll(" ", "_").toUpperCase();
+}
+
+console.log(toUpperSnakeCase("nice to meet you"));
diff --git a/Sprint-2/3-mandatory-implement/3-to-pounds.js b/Sprint-2/3-mandatory-implement/3-to-pounds.js
index 6265a1a70..a049207e6 100644
--- a/Sprint-2/3-mandatory-implement/3-to-pounds.js
+++ b/Sprint-2/3-mandatory-implement/3-to-pounds.js
@@ -1,6 +1,30 @@
-// In Sprint-1, there is a program written in interpret/to-pounds.js
-
-// You will need to take this code and turn it into a reusable block of code.
-// You will need to declare a function called toPounds with an appropriately named parameter.
-
-// You should call this function a number of times to check it works for different inputs
+// In Sprint-1, there is a program written in interpret/to-pounds.js
+
+// You will need to take this code and turn it into a reusable block of code.
+// You will need to declare a function called toPounds with an appropriately named parameter.
+
+// You should call this function a number of times to check it works for different inputs
+
+function toPounds(penceString) {
+
+ const penceStringWithoutTrailingP = penceString.substring(0, penceString.length - 1);
+
+ const paddedPenceNumberString = penceStringWithoutTrailingP.padStart(3, "0");
+
+ const pounds = paddedPenceNumberString.substring(
+ 0,
+ paddedPenceNumberString.length - 2
+ );
+
+ const pence = paddedPenceNumberString
+ .substring(paddedPenceNumberString.length - 2)
+ .padEnd(2, "0");
+
+ return `£${pounds}.${pence}`;
+}
+
+console.log(toPounds("677p"));
+console.log(toPounds("5p"));
+console.log(toPounds("1539p"));
+
+
diff --git a/Sprint-2/4-mandatory-interpret/time-format.js b/Sprint-2/4-mandatory-interpret/time-format.js
index 7c98eb0e8..a020aa399 100644
--- a/Sprint-2/4-mandatory-interpret/time-format.js
+++ b/Sprint-2/4-mandatory-interpret/time-format.js
@@ -1,34 +1,35 @@
-function pad(num) {
- return num.toString().padStart(2, "0");
-}
-
-function formatTimeDisplay(seconds) {
- const remainingSeconds = seconds % 60;
- const totalMinutes = (seconds - remainingSeconds) / 60;
- const remainingMinutes = totalMinutes % 60;
- const totalHours = (totalMinutes - remainingMinutes) / 60;
-
- return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
-}
-
-// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
-// to help you answer these questions
-
-// Questions
-
-// a) When formatTimeDisplay is called how many times will pad be called?
-// =============> write your answer here
-
-// Call formatTimeDisplay with an input of 61, now answer the following:
-
-// b) What is the value assigned to num when pad is called for the first time?
-// =============> write your answer here
-
-// c) What is the return value of pad is called for the first time?
-// =============> write your answer here
-
-// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
-// =============> write your answer here
-
-// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
-// =============> write your answer here
+function pad(num) {
+ return num.toString().padStart(2, "0");
+}
+
+function formatTimeDisplay(seconds) {
+ const remainingSeconds = seconds % 60;
+ const totalMinutes = (seconds - remainingSeconds) / 60;
+ const remainingMinutes = totalMinutes % 60;
+ const totalHours = (totalMinutes - remainingMinutes) / 60;
+
+ return `${pad(totalHours)}:${pad(remainingMinutes)}:${pad(remainingSeconds)}`;
+}
+console.log(formatTimeDisplay(61)); // Example usage
+
+// You will need to play computer with this example - use the Python Visualiser https://pythontutor.com/visualize.html#mode=edit
+// to help you answer these questions
+
+// Questions
+
+// a) When formatTimeDisplay is called how many times will pad be called?
+// 3 times
+
+// Call formatTimeDisplay with an input of 61, now answer the following:
+
+// b) What is the value assigned to num when pad is called for the first time?
+// it will be 0
+
+// c) What is the return value of pad is called for the first time?
+// it will be "00"
+
+// d) What is the value assigned to num when pad is called for the last time in this program? Explain your answer
+// it will be 1, because the last call to pad is for the remaining seconds which is 1 second in this case
+
+// e) What is the return value assigned to num when pad is called for the last time in this program? Explain your answer
+// "01", because the last call to pad is for the remaining seconds which is 1 second in this case, and it pads it with 0 to get two digits.
diff --git a/Sprint-2/5-stretch-extend/format-time.js b/Sprint-2/5-stretch-extend/format-time.js
index 32a32e66b..09483e2e2 100644
--- a/Sprint-2/5-stretch-extend/format-time.js
+++ b/Sprint-2/5-stretch-extend/format-time.js
@@ -1,25 +1,25 @@
-// This is the latest solution to the problem from the prep.
-// Make sure to do the prep before you do the coursework
-// Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find.
-
-function formatAs12HourClock(time) {
- const hours = Number(time.slice(0, 2));
- if (hours > 12) {
- return `${hours - 12}:00 pm`;
- }
- return `${time} am`;
-}
-
-const currentOutput = formatAs12HourClock("08:00");
-const targetOutput = "08:00 am";
-console.assert(
- currentOutput === targetOutput,
- `current output: ${currentOutput}, target output: ${targetOutput}`
-);
-
-const currentOutput2 = formatAs12HourClock("23:00");
-const targetOutput2 = "11:00 pm";
-console.assert(
- currentOutput2 === targetOutput2,
- `current output: ${currentOutput2}, target output: ${targetOutput2}`
-);
+// This is the latest solution to the problem from the prep.
+// Make sure to do the prep before you do the coursework
+// Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find.
+
+function formatAs12HourClock(time) {
+ const hours = Number(time.slice(0, 2));
+ if (hours > 12) {
+ return `${hours - 12}:00 pm`;
+ }
+ return `${time} am`;
+}
+
+const currentOutput = formatAs12HourClock("08:00");
+const targetOutput = "08:00 am";
+console.assert(
+ currentOutput === targetOutput,
+ `current output: ${currentOutput}, target output: ${targetOutput}`
+);
+
+const currentOutput2 = formatAs12HourClock("23:00");
+const targetOutput2 = "11:00 pm";
+console.assert(
+ currentOutput2 === targetOutput2,
+ `current output: ${currentOutput2}, target output: ${targetOutput2}`
+);
diff --git a/Sprint-2/readme.md b/Sprint-2/readme.md
index 44c118e33..301a97116 100644
--- a/Sprint-2/readme.md
+++ b/Sprint-2/readme.md
@@ -1,41 +1,41 @@
-# 🧭 Guide to week 2 exercises
-
-> https://programming.codeyourfuture.io/structuring-data/sprints/2/prep/
-
-> [!TIP]
-> You should always do the prep work _before_ attempting the coursework.
-> The prep shows you how to do the coursework.
-> There is often a step by step video you can code along with too.
-> Do the prep.
-
-## 1 Errors
-
-In this section, you need to go to each file in `errors` directory. Read the file and predict what error will happen. Then run the file with node to check what the error is. Your task is to interpret the error message and explain why it occurs. The [errors documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors) will help you figure out the solution.
-
-## 2 Debug
-
-In this section, you need to go to each file in `debug` to **explain and predict** why the program isn't behaving as intended. Then you'll need to run the program with node to check your prediction. You will also need to correct the code too.
-
-## 3 Implement
-
-In this section, you will have a short set of requirements about a function. You will need to implement a function based off this set of requirements. Make sure you check your function works for a number of different inputs.
-
-Here is a recommended order:
-
-1. `1-bmi.js`
-1. `2-cases.js`
-1. `3-to-pounds.js`
-
-## 4 Interpret
-
-In these tasks, you have to interpret a slightly larger program with some syntax / operators / functions that may be unfamiliar.
-
-You must use documentation to make sense of anything unfamiliar. Learning how to look things up this way is a fundamental part of being a developer!
-
-You can also use `console.log` to check the value of different variables in the code.
-
-## 5 Extend
-
-In the prep for this sprint, we developed a function to convert 24 hour clock times to 12 hour clock times.
-
-Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find. This section is not mandatory, but it will also help you solve some similar kata in Codewars.
+# 🧭 Guide to week 2 exercises
+
+> https://programming.codeyourfuture.io/structuring-data/sprints/2/prep/
+
+> [!TIP]
+> You should always do the prep work _before_ attempting the coursework.
+> The prep shows you how to do the coursework.
+> There is often a step by step video you can code along with too.
+> Do the prep.
+
+## 1 Errors
+
+In this section, you need to go to each file in `errors` directory. Read the file and predict what error will happen. Then run the file with node to check what the error is. Your task is to interpret the error message and explain why it occurs. The [errors documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors) will help you figure out the solution.
+
+## 2 Debug
+
+In this section, you need to go to each file in `debug` to **explain and predict** why the program isn't behaving as intended. Then you'll need to run the program with node to check your prediction. You will also need to correct the code too.
+
+## 3 Implement
+
+In this section, you will have a short set of requirements about a function. You will need to implement a function based off this set of requirements. Make sure you check your function works for a number of different inputs.
+
+Here is a recommended order:
+
+1. `1-bmi.js`
+1. `2-cases.js`
+1. `3-to-pounds.js`
+
+## 4 Interpret
+
+In these tasks, you have to interpret a slightly larger program with some syntax / operators / functions that may be unfamiliar.
+
+You must use documentation to make sense of anything unfamiliar. Learning how to look things up this way is a fundamental part of being a developer!
+
+You can also use `console.log` to check the value of different variables in the code.
+
+## 5 Extend
+
+In the prep for this sprint, we developed a function to convert 24 hour clock times to 12 hour clock times.
+
+Your task is to write tests for as many different groups of input data or edge cases as you can, and fix any bugs you find. This section is not mandatory, but it will also help you solve some similar kata in Codewars.
diff --git a/Sprint-3/1-key-implement/1-get-angle-type.js b/Sprint-3/1-key-implement/1-get-angle-type.js
index 08d1f0cba..4762c1a97 100644
--- a/Sprint-3/1-key-implement/1-get-angle-type.js
+++ b/Sprint-3/1-key-implement/1-get-angle-type.js
@@ -1,56 +1,56 @@
-// Implement a function getAngleType
-// Build up your function case by case, writing tests as you go
-// The first test and case is written for you. The next case has a test, but no code.
-// Execute this script in your terminal
-// node 1-get-angle-type.js
-// The assertion error will tell you what the expected output is
-// Write the code to pass the test
-// Then, write the next test! :) Go through this process until all the cases are implemented
-
-function getAngleType(angle) {
- if (angle === 90) return "Right angle";
- // read to the end, complete line 36, then pass your test here
-}
-
-// we're going to use this helper function to make our assertions easier to read
-// if the actual output matches the target output, the test will pass
-function assertEquals(actualOutput, targetOutput) {
- console.assert(
- actualOutput === targetOutput,
- `Expected ${actualOutput} to equal ${targetOutput}`
- );
-}
-
-// Acceptance criteria:
-
-// Given an angle in degrees,
-// When the function getAngleType is called with this angle,
-// Then it should:
-
-// Case 1: Identify Right Angles:
-// When the angle is exactly 90 degrees,
-// Then the function should return "Right angle"
-const right = getAngleType(90);
-assertEquals(right, "Right angle");
-
-// Case 2: Identify Acute Angles:
-// When the angle is less than 90 degrees,
-// Then the function should return "Acute angle"
-const acute = getAngleType(45);
-assertEquals(acute, "Acute angle");
-
-// Case 3: Identify Obtuse Angles:
-// When the angle is greater than 90 degrees and less than 180 degrees,
-// Then the function should return "Obtuse angle"
-const obtuse = getAngleType(120);
-// ====> write your test here, and then add a line to pass the test in the function above
-
-// Case 4: Identify Straight Angles:
-// When the angle is exactly 180 degrees,
-// Then the function should return "Straight angle"
-// ====> write your test here, and then add a line to pass the test in the function above
-
-// Case 5: Identify Reflex Angles:
-// When the angle is greater than 180 degrees and less than 360 degrees,
-// Then the function should return "Reflex angle"
+// Implement a function getAngleType
+// Build up your function case by case, writing tests as you go
+// The first test and case is written for you. The next case has a test, but no code.
+// Execute this script in your terminal
+// node 1-get-angle-type.js
+// The assertion error will tell you what the expected output is
+// Write the code to pass the test
+// Then, write the next test! :) Go through this process until all the cases are implemented
+
+function getAngleType(angle) {
+ if (angle === 90) return "Right angle";
+ // read to the end, complete line 36, then pass your test here
+}
+
+// we're going to use this helper function to make our assertions easier to read
+// if the actual output matches the target output, the test will pass
+function assertEquals(actualOutput, targetOutput) {
+ console.assert(
+ actualOutput === targetOutput,
+ `Expected ${actualOutput} to equal ${targetOutput}`
+ );
+}
+
+// Acceptance criteria:
+
+// Given an angle in degrees,
+// When the function getAngleType is called with this angle,
+// Then it should:
+
+// Case 1: Identify Right Angles:
+// When the angle is exactly 90 degrees,
+// Then the function should return "Right angle"
+const right = getAngleType(90);
+assertEquals(right, "Right angle");
+
+// Case 2: Identify Acute Angles:
+// When the angle is less than 90 degrees,
+// Then the function should return "Acute angle"
+const acute = getAngleType(45);
+assertEquals(acute, "Acute angle");
+
+// Case 3: Identify Obtuse Angles:
+// When the angle is greater than 90 degrees and less than 180 degrees,
+// Then the function should return "Obtuse angle"
+const obtuse = getAngleType(120);
+// ====> write your test here, and then add a line to pass the test in the function above
+
+// Case 4: Identify Straight Angles:
+// When the angle is exactly 180 degrees,
+// Then the function should return "Straight angle"
+// ====> write your test here, and then add a line to pass the test in the function above
+
+// Case 5: Identify Reflex Angles:
+// When the angle is greater than 180 degrees and less than 360 degrees,
+// Then the function should return "Reflex angle"
// ====> write your test here, and then add a line to pass the test in the function above
\ No newline at end of file
diff --git a/Sprint-3/1-key-implement/2-is-proper-fraction.js b/Sprint-3/1-key-implement/2-is-proper-fraction.js
index 91583e941..702a5df14 100644
--- a/Sprint-3/1-key-implement/2-is-proper-fraction.js
+++ b/Sprint-3/1-key-implement/2-is-proper-fraction.js
@@ -1,53 +1,53 @@
-// Implement a function isProperFraction
-// Write assertions for your function to check it works in different cases
-// Terms:
-// Fractions: https://www.bbc.co.uk/bitesize/topics/zt9n6g8/articles/zjxpp4j
-// Written here like this: 1/2 == Numerator/Denominator
-// the first test and first case is written for you
-// complete the rest of the tests and cases
-// write one test at a time, and make it pass, build your solution up methodically
-
-function isProperFraction(numerator, denominator) {
- if (numerator < denominator) return true;
-}
-
-// here's our helper again
-function assertEquals(actualOutput, targetOutput) {
- console.assert(
- actualOutput === targetOutput,
- `Expected ${actualOutput} to equal ${targetOutput}`
- );
-}
-
-// Acceptance criteria:
-
-// Proper Fraction check:
-// Input: numerator = 2, denominator = 3
-// target output: true
-// Explanation: The fraction 2/3 is a proper fraction, where the numerator is less than the denominator. The function should return true.
-const properFraction = isProperFraction(2, 3);
-assertEquals(properFraction, true);
-
-// Improper Fraction check:
-// Input: numerator = 5, denominator = 2
-// target output: false
-// Explanation: The fraction 5/2 is an improper fraction, where the numerator is greater than or equal to the denominator. The function should return false.
-const improperFraction = isProperFraction(5, 2);
-assertEquals(improperFraction, false);
-
-// Negative Fraction check:
-// Input: numerator = -4, denominator = 7
-// target output: true
-// Explanation: The fraction -4/7 is a proper fraction because the absolute value of the numerator (4) is less than the denominator (7). The function should return true.
-const negativeFraction = isProperFraction(-4, 7);
-// ====> complete with your assertion
-
-// Equal Numerator and Denominator check:
-// Input: numerator = 3, denominator = 3
-// target output: false
-// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
-const equalFraction = isProperFraction(3, 3);
-// ====> complete with your assertion
-
-// Stretch:
-// What other scenarios could you test for?
+// Implement a function isProperFraction
+// Write assertions for your function to check it works in different cases
+// Terms:
+// Fractions: https://www.bbc.co.uk/bitesize/topics/zt9n6g8/articles/zjxpp4j
+// Written here like this: 1/2 == Numerator/Denominator
+// the first test and first case is written for you
+// complete the rest of the tests and cases
+// write one test at a time, and make it pass, build your solution up methodically
+
+function isProperFraction(numerator, denominator) {
+ if (numerator < denominator) return true;
+}
+
+// here's our helper again
+function assertEquals(actualOutput, targetOutput) {
+ console.assert(
+ actualOutput === targetOutput,
+ `Expected ${actualOutput} to equal ${targetOutput}`
+ );
+}
+
+// Acceptance criteria:
+
+// Proper Fraction check:
+// Input: numerator = 2, denominator = 3
+// target output: true
+// Explanation: The fraction 2/3 is a proper fraction, where the numerator is less than the denominator. The function should return true.
+const properFraction = isProperFraction(2, 3);
+assertEquals(properFraction, true);
+
+// Improper Fraction check:
+// Input: numerator = 5, denominator = 2
+// target output: false
+// Explanation: The fraction 5/2 is an improper fraction, where the numerator is greater than or equal to the denominator. The function should return false.
+const improperFraction = isProperFraction(5, 2);
+assertEquals(improperFraction, false);
+
+// Negative Fraction check:
+// Input: numerator = -4, denominator = 7
+// target output: true
+// Explanation: The fraction -4/7 is a proper fraction because the absolute value of the numerator (4) is less than the denominator (7). The function should return true.
+const negativeFraction = isProperFraction(-4, 7);
+// ====> complete with your assertion
+
+// Equal Numerator and Denominator check:
+// Input: numerator = 3, denominator = 3
+// target output: false
+// Explanation: The fraction 3/3 is not a proper fraction because the numerator is equal to the denominator. The function should return false.
+const equalFraction = isProperFraction(3, 3);
+// ====> complete with your assertion
+
+// Stretch:
+// What other scenarios could you test for?
diff --git a/Sprint-3/1-key-implement/3-get-card-value.js b/Sprint-3/1-key-implement/3-get-card-value.js
index aa1cc9f90..1befdb846 100644
--- a/Sprint-3/1-key-implement/3-get-card-value.js
+++ b/Sprint-3/1-key-implement/3-get-card-value.js
@@ -1,51 +1,51 @@
-// This problem involves playing cards: https://en.wikipedia.org/wiki/Standard_52-card_deck
-
-// You will need to implement a function getCardValue
-// the function takes a single parameter, a string representing a playing card
-// the function should return the numerical value of the card
-// the first test and first case is written for you
-// complete the rest of the tests and cases
-// write one test at a time, and make it pass, build your solution up methodically
-// just make one change at a time -- don't rush -- programmers are deep and careful thinkers
-function getCardValue(card) {
- if (rank === "A") return 11;
-}
-
-// You need to write assertions for your function to check it works in different cases
-// we're going to use this helper function to make our assertions easier to read
-// if the actual output matches the target output, the test will pass
-function assertEquals(actualOutput, targetOutput) {
- console.assert(
- actualOutput === targetOutput,
- `Expected ${actualOutput} to equal ${targetOutput}`
- );
-}
-// Acceptance criteria:
-
-// Given a card string in the format "A♠" (representing a card in blackjack - the last character will always be an emoji for a suit, and all characters before will be a number 2-10, or one letter of J, Q, K, A),
-// When the function getCardValue is called with this card string as input,
-// Then it should return the numerical card value
-const aceofSpades = getCardValue("A♠");
-assertEquals(aceofSpades, 11);
-
-// Handle Number Cards (2-10):
-// Given a card with a rank between "2" and "9",
-// When the function is called with such a card,
-// Then it should return the numeric value corresponding to the rank (e.g., "5" should return 5).
-const fiveofHearts = getCardValue("5♥");
-// ====> write your test here, and then add a line to pass the test in the function above
-
-// Handle Face Cards (J, Q, K):
-// Given a card with a rank of "10," "J," "Q," or "K",
-// When the function is called with such a card,
-// Then it should return the value 10, as these cards are worth 10 points each in blackjack.
-
-// Handle Ace (A):
-// Given a card with a rank of "A",
-// When the function is called with an Ace,
-// Then it should, by default, assume the Ace is worth 11 points, which is a common rule in blackjack.
-
-// Handle Invalid Cards:
-// Given a card with an invalid rank (neither a number nor a recognized face card),
-// When the function is called with such a card,
-// Then it should throw an error indicating "Invalid card rank."
+// This problem involves playing cards: https://en.wikipedia.org/wiki/Standard_52-card_deck
+
+// You will need to implement a function getCardValue
+// the function takes a single parameter, a string representing a playing card
+// the function should return the numerical value of the card
+// the first test and first case is written for you
+// complete the rest of the tests and cases
+// write one test at a time, and make it pass, build your solution up methodically
+// just make one change at a time -- don't rush -- programmers are deep and careful thinkers
+function getCardValue(card) {
+ if (rank === "A") return 11;
+}
+
+// You need to write assertions for your function to check it works in different cases
+// we're going to use this helper function to make our assertions easier to read
+// if the actual output matches the target output, the test will pass
+function assertEquals(actualOutput, targetOutput) {
+ console.assert(
+ actualOutput === targetOutput,
+ `Expected ${actualOutput} to equal ${targetOutput}`
+ );
+}
+// Acceptance criteria:
+
+// Given a card string in the format "A♠" (representing a card in blackjack - the last character will always be an emoji for a suit, and all characters before will be a number 2-10, or one letter of J, Q, K, A),
+// When the function getCardValue is called with this card string as input,
+// Then it should return the numerical card value
+const aceofSpades = getCardValue("A♠");
+assertEquals(aceofSpades, 11);
+
+// Handle Number Cards (2-10):
+// Given a card with a rank between "2" and "9",
+// When the function is called with such a card,
+// Then it should return the numeric value corresponding to the rank (e.g., "5" should return 5).
+const fiveofHearts = getCardValue("5♥");
+// ====> write your test here, and then add a line to pass the test in the function above
+
+// Handle Face Cards (J, Q, K):
+// Given a card with a rank of "10," "J," "Q," or "K",
+// When the function is called with such a card,
+// Then it should return the value 10, as these cards are worth 10 points each in blackjack.
+
+// Handle Ace (A):
+// Given a card with a rank of "A",
+// When the function is called with an Ace,
+// Then it should, by default, assume the Ace is worth 11 points, which is a common rule in blackjack.
+
+// Handle Invalid Cards:
+// Given a card with an invalid rank (neither a number nor a recognized face card),
+// When the function is called with such a card,
+// Then it should throw an error indicating "Invalid card rank."
diff --git a/Sprint-3/2-mandatory-rewrite/1-get-angle-type.js b/Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
index d61254bd7..869f07d55 100644
--- a/Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
+++ b/Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
@@ -1,18 +1,18 @@
-function getAngleType(angle) {
- if (angle === 90) return "Right angle";
- // replace with your completed function from key-implement
-
-}
-
-
-
-
-
-
-
-
-// Don't get bogged down in this detail
-// Jest uses CommonJS module syntax by default as it's quite old
-// We will upgrade our approach to ES6 modules in the next course module, so for now
-// we have just written the CommonJS module.exports syntax for you
+function getAngleType(angle) {
+ if (angle === 90) return "Right angle";
+ // replace with your completed function from key-implement
+
+}
+
+
+
+
+
+
+
+
+// Don't get bogged down in this detail
+// Jest uses CommonJS module syntax by default as it's quite old
+// We will upgrade our approach to ES6 modules in the next course module, so for now
+// we have just written the CommonJS module.exports syntax for you
module.exports = getAngleType;
\ No newline at end of file
diff --git a/Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js b/Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
index b62827b7c..5bf1c2071 100644
--- a/Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
+++ b/Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
@@ -1,24 +1,24 @@
-const getAngleType = require("./1-get-angle-type");
-
-test("should identify right angle (90°)", () => {
- expect(getAngleType(90)).toEqual("Right angle");
-});
-
-// REPLACE the comments with the tests
-// make your test descriptions as clear and readable as possible
-
-// Case 2: Identify Acute Angles:
-// When the angle is less than 90 degrees,
-// Then the function should return "Acute angle"
-
-// Case 3: Identify Obtuse Angles:
-// When the angle is greater than 90 degrees and less than 180 degrees,
-// Then the function should return "Obtuse angle"
-
-// Case 4: Identify Straight Angles:
-// When the angle is exactly 180 degrees,
-// Then the function should return "Straight angle"
-
-// Case 5: Identify Reflex Angles:
-// When the angle is greater than 180 degrees and less than 360 degrees,
-// Then the function should return "Reflex angle"
+const getAngleType = require("./1-get-angle-type");
+
+test("should identify right angle (90°)", () => {
+ expect(getAngleType(90)).toEqual("Right angle");
+});
+
+// REPLACE the comments with the tests
+// make your test descriptions as clear and readable as possible
+
+// Case 2: Identify Acute Angles:
+// When the angle is less than 90 degrees,
+// Then the function should return "Acute angle"
+
+// Case 3: Identify Obtuse Angles:
+// When the angle is greater than 90 degrees and less than 180 degrees,
+// Then the function should return "Obtuse angle"
+
+// Case 4: Identify Straight Angles:
+// When the angle is exactly 180 degrees,
+// Then the function should return "Straight angle"
+
+// Case 5: Identify Reflex Angles:
+// When the angle is greater than 180 degrees and less than 360 degrees,
+// Then the function should return "Reflex angle"
diff --git a/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js b/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
index 9836fe398..28b5e1c18 100644
--- a/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
+++ b/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
@@ -1,6 +1,6 @@
-function isProperFraction(numerator, denominator) {
- if (numerator < denominator) return true;
- // add your completed function from key-implement here
-}
-
+function isProperFraction(numerator, denominator) {
+ if (numerator < denominator) return true;
+ // add your completed function from key-implement here
+}
+
module.exports = isProperFraction;
\ No newline at end of file
diff --git a/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js b/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
index ff1cc8173..75085b4b1 100644
--- a/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
+++ b/Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
@@ -1,11 +1,11 @@
-const isProperFraction = require("./2-is-proper-fraction");
-
-test("should return true for a proper fraction", () => {
- expect(isProperFraction(2, 3)).toEqual(true);
-});
-
-// Case 2: Identify Improper Fractions:
-
-// Case 3: Identify Negative Fractions:
-
-// Case 4: Identify Equal Numerator and Denominator:
+const isProperFraction = require("./2-is-proper-fraction");
+
+test("should return true for a proper fraction", () => {
+ expect(isProperFraction(2, 3)).toEqual(true);
+});
+
+// Case 2: Identify Improper Fractions:
+
+// Case 3: Identify Negative Fractions:
+
+// Case 4: Identify Equal Numerator and Denominator:
diff --git a/Sprint-3/2-mandatory-rewrite/3-get-card-value.js b/Sprint-3/2-mandatory-rewrite/3-get-card-value.js
index 0d95d3736..6d3d969ee 100644
--- a/Sprint-3/2-mandatory-rewrite/3-get-card-value.js
+++ b/Sprint-3/2-mandatory-rewrite/3-get-card-value.js
@@ -1,5 +1,5 @@
-function getCardValue(card) {
- // replace with your code from key-implement
- return 11;
-}
+function getCardValue(card) {
+ // replace with your code from key-implement
+ return 11;
+}
module.exports = getCardValue;
\ No newline at end of file
diff --git a/Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js b/Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
index 03a8e2f34..ab988b1ad 100644
--- a/Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
+++ b/Sprint-3/2-mandatory-rewrite/3-get-card-value.test.js
@@ -1,11 +1,11 @@
-const getCardValue = require("./3-get-card-value");
-
-test("should return 11 for Ace of Spades", () => {
- const aceofSpades = getCardValue("A♠");
- expect(aceofSpades).toEqual(11);
- });
-
-// Case 2: Handle Number Cards (2-10):
-// Case 3: Handle Face Cards (J, Q, K):
-// Case 4: Handle Ace (A):
-// Case 5: Handle Invalid Cards:
+const getCardValue = require("./3-get-card-value");
+
+test("should return 11 for Ace of Spades", () => {
+ const aceofSpades = getCardValue("A♠");
+ expect(aceofSpades).toEqual(11);
+ });
+
+// Case 2: Handle Number Cards (2-10):
+// Case 3: Handle Face Cards (J, Q, K):
+// Case 4: Handle Ace (A):
+// Case 5: Handle Invalid Cards:
diff --git a/Sprint-3/3-mandatory-practice/implement/count.js b/Sprint-3/3-mandatory-practice/implement/count.js
index fce249650..f17a42925 100644
--- a/Sprint-3/3-mandatory-practice/implement/count.js
+++ b/Sprint-3/3-mandatory-practice/implement/count.js
@@ -1,5 +1,5 @@
-function countChar(stringOfCharacters, findCharacter) {
- return 5
-}
-
+function countChar(stringOfCharacters, findCharacter) {
+ return 5
+}
+
module.exports = countChar;
\ No newline at end of file
diff --git a/Sprint-3/3-mandatory-practice/implement/count.test.js b/Sprint-3/3-mandatory-practice/implement/count.test.js
index 42baf4b4b..4cf7ad974 100644
--- a/Sprint-3/3-mandatory-practice/implement/count.test.js
+++ b/Sprint-3/3-mandatory-practice/implement/count.test.js
@@ -1,24 +1,24 @@
-// implement a function countChar that counts the number of times a character occurs in a string
-const countChar = require("./count");
-// Given a string str and a single character char to search for,
-// When the countChar function is called with these inputs,
-// Then it should:
-
-// Scenario: Multiple Occurrences
-// Given the input string str,
-// And a character char that may occur multiple times with overlaps within str (e.g., 'a' in 'aaaaa'),
-// When the function is called with these inputs,
-// Then it should correctly count overlapping occurrences of char (e.g., 'a' appears five times in 'aaaaa').
-
-test("should count multiple occurrences of a character", () => {
- const str = "aaaaa";
- const char = "a";
- const count = countChar(str, char);
- expect(count).toEqual(5);
-});
-
-// Scenario: No Occurrences
-// Given the input string str,
-// And a character char that does not exist within the case-sensitive str,
-// When the function is called with these inputs,
-// Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str.
+// implement a function countChar that counts the number of times a character occurs in a string
+const countChar = require("./count");
+// Given a string str and a single character char to search for,
+// When the countChar function is called with these inputs,
+// Then it should:
+
+// Scenario: Multiple Occurrences
+// Given the input string str,
+// And a character char that may occur multiple times with overlaps within str (e.g., 'a' in 'aaaaa'),
+// When the function is called with these inputs,
+// Then it should correctly count overlapping occurrences of char (e.g., 'a' appears five times in 'aaaaa').
+
+test("should count multiple occurrences of a character", () => {
+ const str = "aaaaa";
+ const char = "a";
+ const count = countChar(str, char);
+ expect(count).toEqual(5);
+});
+
+// Scenario: No Occurrences
+// Given the input string str,
+// And a character char that does not exist within the case-sensitive str,
+// When the function is called with these inputs,
+// Then it should return 0, indicating that no occurrences of the char were found in the case-sensitive str.
diff --git a/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.js b/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.js
index 24f528b0d..5a1cc434b 100644
--- a/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.js
+++ b/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.js
@@ -1,5 +1,5 @@
-function getOrdinalNumber(num) {
- return "1st";
-}
-
+function getOrdinalNumber(num) {
+ return "1st";
+}
+
module.exports = getOrdinalNumber;
\ No newline at end of file
diff --git a/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js b/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
index 6d55dfbb4..1aba5b296 100644
--- a/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
+++ b/Sprint-3/3-mandatory-practice/implement/get-ordinal-number.test.js
@@ -1,13 +1,13 @@
-const getOrdinalNumber = require("./get-ordinal-number");
-// In this week's prep, we started implementing getOrdinalNumber
-
-// continue testing and implementing getOrdinalNumber for additional cases
-// Write your tests using Jest - remember to run your tests often for continual feedback
-
-// Case 1: Identify the ordinal number for 1
-// When the number is 1,
-// Then the function should return "1st"
-
-test("should return '1st' for 1", () => {
- expect(getOrdinalNumber(1)).toEqual("1st");
- });
+const getOrdinalNumber = require("./get-ordinal-number");
+// In this week's prep, we started implementing getOrdinalNumber
+
+// continue testing and implementing getOrdinalNumber for additional cases
+// Write your tests using Jest - remember to run your tests often for continual feedback
+
+// Case 1: Identify the ordinal number for 1
+// When the number is 1,
+// Then the function should return "1st"
+
+test("should return '1st' for 1", () => {
+ expect(getOrdinalNumber(1)).toEqual("1st");
+ });
diff --git a/Sprint-3/3-mandatory-practice/implement/repeat.js b/Sprint-3/3-mandatory-practice/implement/repeat.js
index 621f9bd35..4b8a7a858 100644
--- a/Sprint-3/3-mandatory-practice/implement/repeat.js
+++ b/Sprint-3/3-mandatory-practice/implement/repeat.js
@@ -1,5 +1,5 @@
-function repeat() {
- return "hellohellohello";
-}
-
+function repeat() {
+ return "hellohellohello";
+}
+
module.exports = repeat;
\ No newline at end of file
diff --git a/Sprint-3/3-mandatory-practice/implement/repeat.test.js b/Sprint-3/3-mandatory-practice/implement/repeat.test.js
index 8a4ab42ef..a24094d40 100644
--- a/Sprint-3/3-mandatory-practice/implement/repeat.test.js
+++ b/Sprint-3/3-mandatory-practice/implement/repeat.test.js
@@ -1,32 +1,32 @@
-// Implement a function repeat
-const repeat = require("./repeat");
-// Given a target string str and a positive integer count,
-// When the repeat function is called with these inputs,
-// Then it should:
-
-// case: repeat String:
-// Given a target string str and a positive integer count,
-// When the repeat function is called with these inputs,
-// Then it should repeat the str count times and return a new string containing the repeated str values.
-
-test("should repeat the string count times", () => {
- const str = "hello";
- const count = 3;
- const repeatedStr = repeat(str, count);
- expect(repeatedStr).toEqual("hellohellohello");
- });
-
-// case: handle Count of 1:
-// Given a target string str and a count equal to 1,
-// When the repeat function is called with these inputs,
-// Then it should return the original str without repetition, ensuring that a count of 1 results in no repetition.
-
-// case: Handle Count of 0:
-// Given a target string str and a count equal to 0,
-// When the repeat function is called with these inputs,
-// Then it should return an empty string, ensuring that a count of 0 results in an empty output.
-
-// case: Negative Count:
-// Given a target string str and a negative integer count,
-// When the repeat function is called with these inputs,
-// Then it should throw an error or return an appropriate error message, as negative counts are not valid.
+// Implement a function repeat
+const repeat = require("./repeat");
+// Given a target string str and a positive integer count,
+// When the repeat function is called with these inputs,
+// Then it should:
+
+// case: repeat String:
+// Given a target string str and a positive integer count,
+// When the repeat function is called with these inputs,
+// Then it should repeat the str count times and return a new string containing the repeated str values.
+
+test("should repeat the string count times", () => {
+ const str = "hello";
+ const count = 3;
+ const repeatedStr = repeat(str, count);
+ expect(repeatedStr).toEqual("hellohellohello");
+ });
+
+// case: handle Count of 1:
+// Given a target string str and a count equal to 1,
+// When the repeat function is called with these inputs,
+// Then it should return the original str without repetition, ensuring that a count of 1 results in no repetition.
+
+// case: Handle Count of 0:
+// Given a target string str and a count equal to 0,
+// When the repeat function is called with these inputs,
+// Then it should return an empty string, ensuring that a count of 0 results in an empty output.
+
+// case: Negative Count:
+// Given a target string str and a negative integer count,
+// When the repeat function is called with these inputs,
+// Then it should throw an error or return an appropriate error message, as negative counts are not valid.
diff --git a/Sprint-3/4-stretch-investigate/card-validator.md b/Sprint-3/4-stretch-investigate/card-validator.md
index e39c6ace6..26b72a00d 100644
--- a/Sprint-3/4-stretch-investigate/card-validator.md
+++ b/Sprint-3/4-stretch-investigate/card-validator.md
@@ -1,35 +1,35 @@
-## **PROJECT: Credit Card Validator**
-
-In this project you'll write a script that validates whether or not a credit card number is valid.
-
-Here are the rules for a valid number:
-
-- Number must be 16 digits, all of them must be numbers.
-- You must have at least two different digits represented (all of the digits cannot be the same).
-- The final digit must be even.
-- The sum of all the digits must be greater than 16.
-
-For example, the following credit card numbers are valid:
-
-```markdown
-9999777788880000
-6666666666661666
-```
-
-And the following credit card numbers are invalid:
-
-```markdown
-a92332119c011112 (invalid characters)
-4444444444444444 (only one type of number)
-1111111111111110 (sum less than 16)
-6666666666666661 (odd final number)
-```
-
-These are the requirements your project needs to fulfill:
-
-- Make a JavaScript file with a name that describes its contents.
-- Create a function with a descriptive name which makes it clear what the function does. The function should take one argument, the credit card number to validate.
-- Write at least 2 comments that explain to others what a line of code is meant to do.
-- Return a boolean from the function to indicate whether the credit card number is valid.
-
-Good luck!
+## **PROJECT: Credit Card Validator**
+
+In this project you'll write a script that validates whether or not a credit card number is valid.
+
+Here are the rules for a valid number:
+
+- Number must be 16 digits, all of them must be numbers.
+- You must have at least two different digits represented (all of the digits cannot be the same).
+- The final digit must be even.
+- The sum of all the digits must be greater than 16.
+
+For example, the following credit card numbers are valid:
+
+```markdown
+9999777788880000
+6666666666661666
+```
+
+And the following credit card numbers are invalid:
+
+```markdown
+a92332119c011112 (invalid characters)
+4444444444444444 (only one type of number)
+1111111111111110 (sum less than 16)
+6666666666666661 (odd final number)
+```
+
+These are the requirements your project needs to fulfill:
+
+- Make a JavaScript file with a name that describes its contents.
+- Create a function with a descriptive name which makes it clear what the function does. The function should take one argument, the credit card number to validate.
+- Write at least 2 comments that explain to others what a line of code is meant to do.
+- Return a boolean from the function to indicate whether the credit card number is valid.
+
+Good luck!
diff --git a/Sprint-3/4-stretch-investigate/find.js b/Sprint-3/4-stretch-investigate/find.js
index c7e79a2f2..dd7f06a9a 100644
--- a/Sprint-3/4-stretch-investigate/find.js
+++ b/Sprint-3/4-stretch-investigate/find.js
@@ -1,25 +1,25 @@
-function find(str, char) {
- let index = 0;
-
- while (index < str.length) {
- if (str[index] === char) {
- return index;
- }
- index++;
- }
- return -1;
-}
-
-console.log(find("code your future", "u"));
-console.log(find("code your future", "z"));
-
-// The while loop statement allows us to do iteration - the repetition of a certain number of tasks according to some condition
-// See the docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while
-
-// Use the Python Visualiser to help you play computer with this example and observe how this code is executed
-// Pay particular attention to the following:
-
-// a) How the index variable updates during the call to find
-// b) What is the if statement used to check
-// c) Why is index++ being used?
-// d) What is the condition index < str.length used for?
+function find(str, char) {
+ let index = 0;
+
+ while (index < str.length) {
+ if (str[index] === char) {
+ return index;
+ }
+ index++;
+ }
+ return -1;
+}
+
+console.log(find("code your future", "u"));
+console.log(find("code your future", "z"));
+
+// The while loop statement allows us to do iteration - the repetition of a certain number of tasks according to some condition
+// See the docs https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/while
+
+// Use the Python Visualiser to help you play computer with this example and observe how this code is executed
+// Pay particular attention to the following:
+
+// a) How the index variable updates during the call to find
+// b) What is the if statement used to check
+// c) Why is index++ being used?
+// d) What is the condition index < str.length used for?
diff --git a/Sprint-3/4-stretch-investigate/password-validator.js b/Sprint-3/4-stretch-investigate/password-validator.js
index b55d527db..1af3c41c5 100644
--- a/Sprint-3/4-stretch-investigate/password-validator.js
+++ b/Sprint-3/4-stretch-investigate/password-validator.js
@@ -1,6 +1,6 @@
-function passwordValidator(password) {
- return password.length < 5 ? false : true
-}
-
-
+function passwordValidator(password) {
+ return password.length < 5 ? false : true
+}
+
+
module.exports = passwordValidator;
\ No newline at end of file
diff --git a/Sprint-3/4-stretch-investigate/password-validator.test.js b/Sprint-3/4-stretch-investigate/password-validator.test.js
index 8fa3089d6..ede1f1f3b 100644
--- a/Sprint-3/4-stretch-investigate/password-validator.test.js
+++ b/Sprint-3/4-stretch-investigate/password-validator.test.js
@@ -1,26 +1,26 @@
-/*
-Password Validation
-
-Write a program that should check if a password is valid
-and returns a boolean
-
-To be valid, a password must:
-- Have at least 5 characters.
-- Have at least one English uppercase letter (A-Z)
-- Have at least one English lowercase letter (a-z)
-- Have at least one number (0-9)
-- Have at least one of the following non-alphanumeric symbols: ("!", "#", "$", "%", ".", "*", "&")
-- Must not be any previous password in the passwords array.
-
-You must breakdown this problem in order to solve it. Find one test case first and get that working
-*/
-const isValidPassword = require("./password-validator");
-test("password has at least 5 characters", () => {
- // Arrange
- const password = "12345";
- // Act
- const result = isValidPassword(password);
- // Assert
- expect(result).toEqual(true);
-}
+/*
+Password Validation
+
+Write a program that should check if a password is valid
+and returns a boolean
+
+To be valid, a password must:
+- Have at least 5 characters.
+- Have at least one English uppercase letter (A-Z)
+- Have at least one English lowercase letter (a-z)
+- Have at least one number (0-9)
+- Have at least one of the following non-alphanumeric symbols: ("!", "#", "$", "%", ".", "*", "&")
+- Must not be any previous password in the passwords array.
+
+You must breakdown this problem in order to solve it. Find one test case first and get that working
+*/
+const isValidPassword = require("./password-validator");
+test("password has at least 5 characters", () => {
+ // Arrange
+ const password = "12345";
+ // Act
+ const result = isValidPassword(password);
+ // Assert
+ expect(result).toEqual(true);
+}
);
\ No newline at end of file
diff --git a/Sprint-3/readme.md b/Sprint-3/readme.md
index 4cbb096fb..c996a7aaf 100644
--- a/Sprint-3/readme.md
+++ b/Sprint-3/readme.md
@@ -1,73 +1,73 @@
-# 🧭 Guide to week 3 exercises
-
-> https://programming.codeyourfuture.io/structuring-data/sprints/3/prep/
-
-> [!TIP]
-> You should always do the prep work _before_ attempting the coursework.
-> The prep shows you how to do the coursework.
-> There is often a step by step video you can code along with too.
-> Do the prep.
-
-## 🔧 1 Implement
-
-In the `implement` directory you've got a number of functions you'll need to implement.
-For each function, you also have a number of different cases you'll need to check for your function.
-
-Write your assertions and build up your program case by case. Don't rush to a solution. The point of these assignments is to learn how to write assertions and build up a program step by step.
-
-Here is a recommended order:
-
-1. `1-get-angle-type.js`
-1. `2-is-proper-fraction.js`
-1. `3-get-card-value.js`
-
-## 🔧 2 Rewrite
-
-`console.log` is most often used as a debugging tool. We use to inspect the state of our program during runtime.
-
-We can use `console.assert` to write assertions: however, it is not very easy to use when writing large test suites. In the first section, Implement, we used a custom "helper function" to make our assertions more readable.
-
-Jest is a whole library of helper functions we can use to make our assertions more readable and easier to write.
-
-Your new task is to _rewrite_ the assertions from `./1-key-implement` using Jest syntax.
-Blank files have been created for you. Each script file has a paired `.test.js` file. Write your tests in the test file and the implementation in the script file.
-
-You can run all the tests in this repo by running `npm test` in your terminal. However, VSCode has a built-in test runner that you can use to run the tests, and this should make it much easier to focus on building up your test cases one at a time.
-
-https://code.visualstudio.com/docs/editor/testing
-
-1. Go to 2-mandatory-rewrite/1-get-angle-type.test.js
-1. Click the green play button to run the test. It's on the left of the test function in the gutter.
-1. Read the output in the TEST_RESULTS tab at the bottom of the screen.
-1. Explore all the tests in this repo by opening the TEST EXPLORER tab. The logo is a beaker.
-
-
-
-
-
-> [!TIP]
-> You can always run a single test file by running `npm test path/to/test-file.test.js`.
-
-## 3 Practice
-
-In this section you'll practice this key skill of building up your program test first.
-
-Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress.
-
-Recommended order:
-
-1. `count.test.js`
-1. `repeat.test.js`
-1. `get-ordinal-number.test.js`
-
-## 🔍 4 Investigate Stretch
-
-These stretch activities are not mandatory, but we hope you will explore them after you have completed the key and mandatory work.
-
-In this exercise, you'll need to **play computer** with the function `find`. This function makes use of while loop statement. Your task will be to step through the code to figure out what is happening when the computer executes the code.
-
-Next, try implementing the functions specified in `password-validator.js`.
-
-Finally, set up your own script and test files for `card-validator.md`
-
-
+# 🧭 Guide to week 3 exercises
+
+> https://programming.codeyourfuture.io/structuring-data/sprints/3/prep/
+
+> [!TIP]
+> You should always do the prep work _before_ attempting the coursework.
+> The prep shows you how to do the coursework.
+> There is often a step by step video you can code along with too.
+> Do the prep.
+
+## 🔧 1 Implement
+
+In the `implement` directory you've got a number of functions you'll need to implement.
+For each function, you also have a number of different cases you'll need to check for your function.
+
+Write your assertions and build up your program case by case. Don't rush to a solution. The point of these assignments is to learn how to write assertions and build up a program step by step.
+
+Here is a recommended order:
+
+1. `1-get-angle-type.js`
+1. `2-is-proper-fraction.js`
+1. `3-get-card-value.js`
+
+## 🔧 2 Rewrite
+
+`console.log` is most often used as a debugging tool. We use to inspect the state of our program during runtime.
+
+We can use `console.assert` to write assertions: however, it is not very easy to use when writing large test suites. In the first section, Implement, we used a custom "helper function" to make our assertions more readable.
+
+Jest is a whole library of helper functions we can use to make our assertions more readable and easier to write.
+
+Your new task is to _rewrite_ the assertions from `./1-key-implement` using Jest syntax.
+Blank files have been created for you. Each script file has a paired `.test.js` file. Write your tests in the test file and the implementation in the script file.
+
+You can run all the tests in this repo by running `npm test` in your terminal. However, VSCode has a built-in test runner that you can use to run the tests, and this should make it much easier to focus on building up your test cases one at a time.
+
+https://code.visualstudio.com/docs/editor/testing
+
+1. Go to 2-mandatory-rewrite/1-get-angle-type.test.js
+1. Click the green play button to run the test. It's on the left of the test function in the gutter.
+1. Read the output in the TEST_RESULTS tab at the bottom of the screen.
+1. Explore all the tests in this repo by opening the TEST EXPLORER tab. The logo is a beaker.
+
+
+
+
+
+> [!TIP]
+> You can always run a single test file by running `npm test path/to/test-file.test.js`.
+
+## 3 Practice
+
+In this section you'll practice this key skill of building up your program test first.
+
+Use the Jest syntax and complete the provided files, meeting the acceptance criteria for each function. Use the VSCode test runner to run your tests and check your progress.
+
+Recommended order:
+
+1. `count.test.js`
+1. `repeat.test.js`
+1. `get-ordinal-number.test.js`
+
+## 🔍 4 Investigate Stretch
+
+These stretch activities are not mandatory, but we hope you will explore them after you have completed the key and mandatory work.
+
+In this exercise, you'll need to **play computer** with the function `find`. This function makes use of while loop statement. Your task will be to step through the code to figure out what is happening when the computer executes the code.
+
+Next, try implementing the functions specified in `password-validator.js`.
+
+Finally, set up your own script and test files for `card-validator.md`
+
+
diff --git a/contributing.md b/contributing.md
index 602c69438..ae6f43d27 100644
--- a/contributing.md
+++ b/contributing.md
@@ -1,19 +1,19 @@
-
-
-# How To Submit Your Coursework
-
-Use Git & Github to submit your coursework as a pull request.
-
-[Creating a pull request](https://curriculum.codeyourfuture.io/guides/create-a-pull-request/)
-
-## Questions & Help
-
-Contributing to a remote codebase is a necessary skill for a professional developer. Opening PRs is mandatory at CYF. It is part of the coursework.
-
-If you cannot submit your coursework you **must** post on Slack to get unblocked.
-
-[How to get help](./HOW-TO-GET-HELP.md)
+
+
+# How To Submit Your Coursework
+
+Use Git & Github to submit your coursework as a pull request.
+
+[Creating a pull request](https://curriculum.codeyourfuture.io/guides/create-a-pull-request/)
+
+## Questions & Help
+
+Contributing to a remote codebase is a necessary skill for a professional developer. Opening PRs is mandatory at CYF. It is part of the coursework.
+
+If you cannot submit your coursework you **must** post on Slack to get unblocked.
+
+[How to get help](./HOW-TO-GET-HELP.md)
diff --git a/package.json b/package.json
index 0657e22dd..29e7f537d 100644
--- a/package.json
+++ b/package.json
@@ -1,15 +1,15 @@
-{
- "name": "module-structuring-and-testing-data",
- "version": "1.0.0",
- "description": "Like learning a musical instrument, programming requires daily practice.",
- "main": "index.js",
- "scripts": {
- "test": "jest"
- },
- "keywords": [],
- "author": "Code Your Future",
- "license": "ISC",
- "dependencies": {
- "jest": "^29.7.0"
- }
+{
+ "name": "module-structuring-and-testing-data",
+ "version": "1.0.0",
+ "description": "Like learning a musical instrument, programming requires daily practice.",
+ "main": "index.js",
+ "scripts": {
+ "test": "jest"
+ },
+ "keywords": [],
+ "author": "Code Your Future",
+ "license": "ISC",
+ "dependencies": {
+ "jest": "^29.7.0"
+ }
}
\ No newline at end of file
diff --git a/readme.md b/readme.md
index 873178bda..e6aa31e9d 100644
--- a/readme.md
+++ b/readme.md
@@ -1,29 +1,29 @@
-# Coursework
-
-> https://programming.codeyourfuture.io/structuring-data/
-
-> [!TIP]
-> You should always do the prep work _before_ attempting the coursework.
-> The prep shows you _how_ to do the coursework.
-> There is often a step by step video you can code along with too.
-> Do the prep.
-
-## Setting up your code editor
-
-There are some tools that will help you to write code. One of these, [Prettier](https://prettier.io/), formats your code, making it easier for you and others to read. Another tool, [Jest](https://jestjs.io/), is a test runner that will turn on Test Explorer in Visual Studio Code.
-
-### 1. Using Prettier, Test Runner, and other recommended tools in Visual Studio Code
-
-- Open this repository in Visual Studio Code
-- Accept the prompt to install the recommended extensions
-
-### 2. Enable formatting on save
-
-- In Visual Studio open the settings file (see https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings)
-- Search for `editor format`
-- Set `editor.formatOnSave` and `editor.formatOnPaste` to true
-
-### 3. Install the packages for this coursework
-
-- Open the terminal in Visual Studio Code
-- Run `npm install` in the root of this repository
+# Coursework
+
+> https://programming.codeyourfuture.io/structuring-data/
+
+> [!TIP]
+> You should always do the prep work _before_ attempting the coursework.
+> The prep shows you _how_ to do the coursework.
+> There is often a step by step video you can code along with too.
+> Do the prep.
+
+## Setting up your code editor
+
+There are some tools that will help you to write code. One of these, [Prettier](https://prettier.io/), formats your code, making it easier for you and others to read. Another tool, [Jest](https://jestjs.io/), is a test runner that will turn on Test Explorer in Visual Studio Code.
+
+### 1. Using Prettier, Test Runner, and other recommended tools in Visual Studio Code
+
+- Open this repository in Visual Studio Code
+- Accept the prompt to install the recommended extensions
+
+### 2. Enable formatting on save
+
+- In Visual Studio open the settings file (see https://code.visualstudio.com/docs/getstarted/settings#_creating-user-and-workspace-settings)
+- Search for `editor format`
+- Set `editor.formatOnSave` and `editor.formatOnPaste` to true
+
+### 3. Install the packages for this coursework
+
+- Open the terminal in Visual Studio Code
+- Run `npm install` in the root of this repository