Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
8be0a94
i declared prediction
Gbemisola-Fad Dec 25, 2025
15b03d8
i declared percentage conversion
Gbemisola-Fad Dec 25, 2025
021bf84
i fix error problems
Gbemisola-Fad Dec 25, 2025
692c654
i predict
Gbemisola-Fad Dec 25, 2025
c2d19c1
sun of function
Gbemisola-Fad Dec 25, 2025
f5dab89
i declared the prediction of an output
Gbemisola-Fad Dec 25, 2025
c75033d
i declared diffrent cases
Gbemisola-Fad Dec 25, 2025
8aeaa41
i declared program written
Gbemisola-Fad Dec 25, 2025
7008404
i declared former time display
Gbemisola-Fad Dec 25, 2025
50d5fb4
i declared calculation
Gbemisola-Fad Dec 25, 2025
01a09de
i declared cuurent output
Gbemisola-Fad Dec 25, 2025
93981ca
i declared string representing
Gbemisola-Fad Dec 26, 2025
42bd4f4
i declared functions
Gbemisola-Fad Dec 26, 2025
5b14359
i declared variable
Gbemisola-Fad Dec 26, 2025
6b1e71e
i declared initails
Gbemisola-Fad Dec 26, 2025
5f7e836
i declared filepath variable
Gbemisola-Fad Dec 26, 2025
ce69949
i declared math.floor
Gbemisola-Fad Dec 26, 2025
33872c1
i declared how to solve problem
Gbemisola-Fad Dec 26, 2025
8532238
i declared variable creation
Gbemisola-Fad Dec 26, 2025
0878a26
i declared error
Gbemisola-Fad Dec 26, 2025
63331ef
i declared updating expression
Gbemisola-Fad Dec 26, 2025
a33708d
i declared the clocktime
Gbemisola-Fad Dec 26, 2025
77cbd87
i declared instruction
Gbemisola-Fad Dec 26, 2025
48d2bd7
i declared variable first
Gbemisola-Fad Dec 26, 2025
d4695a2
i declared working on errors
Gbemisola-Fad Dec 26, 2025
8284957
i declared first activity
Gbemisola-Fad Dec 26, 2025
a3df744
i declared totalminutes
Gbemisola-Fad Dec 26, 2025
3e61119
i declared initialize string
Gbemisola-Fad Dec 26, 2025
ee5c6d9
i declared function alert
Gbemisola-Fad Dec 26, 2025
7820bd0
i declared consolelog
Gbemisola-Fad Dec 26, 2025
7739b5d
I implemented the function of getAngleTypes and run test case by case
Gbemisola-Fad Jan 10, 2026
8afb4a9
I implemented isProperFraction
Gbemisola-Fad Jan 10, 2026
0a80e2c
I implemented getCardValue
Gbemisola-Fad Jan 10, 2026
01d1107
I provided a function on getAngleType
Gbemisola-Fad Jan 10, 2026
b8c9082
I provided a getAngleType when required
Gbemisola-Fad Jan 10, 2026
787ef52
I provided a getAngleTypetest
Gbemisola-Fad Jan 10, 2026
51dc2de
I generated isProperFraction
Gbemisola-Fad Jan 10, 2026
30083f4
I provided a required isProperFraction
Gbemisola-Fad Jan 10, 2026
45f285c
I generated a getCardValue
Gbemisola-Fad Jan 10, 2026
8b93a1d
I provided a required getCardValue
Gbemisola-Fad Jan 10, 2026
743af28
I provided a countcharater
Gbemisola-Fad Jan 10, 2026
ce3b1a6
I provided a required countchar
Gbemisola-Fad Jan 10, 2026
4109e2e
I provided a getOrdinalNumber
Gbemisola-Fad Jan 10, 2026
ea53d0a
I provided a required getOrdinalNumber
Gbemisola-Fad Jan 10, 2026
f4a3d6d
I repeat a function
Gbemisola-Fad Jan 10, 2026
0a7170f
i repeated a test function
Gbemisola-Fad Jan 10, 2026
482d66c
I provided a credit card
Gbemisola-Fad Jan 10, 2026
f6f2fa4
I find a function
Gbemisola-Fad Jan 10, 2026
940de78
I provided a passwordvalidator
Gbemisola-Fad Jan 10, 2026
1a5ffff
I provided password validation
Gbemisola-Fad Jan 10, 2026
cf6cfed
Merge pull request #3 from Gbemisola-Fad/sprint-3-new
Gbemisola-Fad Jan 12, 2026
50f77c0
I implemented the function getAngletype
Gbemisola-Fad Jan 26, 2026
bd99822
I implemented a proper fraction
Gbemisola-Fad Jan 26, 2026
9345de9
I implemented getCardValue
Gbemisola-Fad Jan 26, 2026
3ea6dba
implementing function of return
Gbemisola-Fad Jan 26, 2026
01a5860
implementing getAngleType
Gbemisola-Fad Jan 26, 2026
2d879fa
identifying reflex angle
Gbemisola-Fad Jan 26, 2026
8ac608d
implementing ProperFraction
Gbemisola-Fad Jan 26, 2026
6cb0939
identifying negative fraction
Gbemisola-Fad Jan 26, 2026
fad0f12
identifying equal number
Gbemisola-Fad Jan 26, 2026
58bca4e
handling invalid cards
Gbemisola-Fad Jan 26, 2026
8be9a14
implement findCharacter
Gbemisola-Fad Jan 26, 2026
c895483
I implement countChar
Gbemisola-Fad Jan 26, 2026
466cf0d
identifying module exports
Gbemisola-Fad Jan 26, 2026
bc4333f
implementing getOrdinalNumber
Gbemisola-Fad Jan 26, 2026
9993c58
implement function repeat
Gbemisola-Fad Jan 26, 2026
b3e7106
implementing negative count
Gbemisola-Fad Jan 26, 2026
5f9fbe5
implementing find function
Gbemisola-Fad Jan 26, 2026
f7e50ac
implementing password
Gbemisola-Fad Jan 26, 2026
b5a1347
implement ValidPassword
Gbemisola-Fad Jan 26, 2026
333404b
implement credit card
Gbemisola-Fad Jan 26, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sprint-1/1-key-exercises/1-count.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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
// Describe what line 3 is doing, in particular focus on what = is doing
1 change: 0 additions & 1 deletion Sprint-1/1-key-exercises/2-initials.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ let lastName = "Johnson";
let initials = ``;

// https://www.google.com/search?q=get+first+character+of+string+mdn

8 changes: 6 additions & 2 deletions Sprint-1/1-key-exercises/3-paths.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ 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
const dir = filePath.slice(0, lastSlashIndex);

// Create a variable to store the ext part of the variable
const extIndex = base.lastIndexOf(".");
const ext = base.slice(extIndex + 1);

const dir = ;
const ext = ;
console.log(`The directory part is ${dir}`);
console.log(`The extension part is ${ext}`);

// https://www.google.com/search?q=slice+mdn
2 changes: 1 addition & 1 deletion Sprint-1/1-key-exercises/4-random.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ 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
// Try logging the value of num and running the program several times to build an idea of what the program is doing
2 changes: 1 addition & 1 deletion Sprint-1/2-mandatory-errors/0.js
Original file line number Diff line number Diff line change
@@ -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?
We don't want the computer to run these 2 lines - how can we solve this problem?
2 changes: 1 addition & 1 deletion Sprint-1/2-mandatory-errors/1.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// trying to create an age variable and then reassign the value by 1

const age = 33;
age = age + 1;
age = age + 1;
2 changes: 1 addition & 1 deletion Sprint-1/2-mandatory-errors/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// what's the error ?

console.log(`I was born in ${cityOfBirth}`);
const cityOfBirth = "Bolton";
const cityOfBirth = "Bolton";
2 changes: 1 addition & 1 deletion Sprint-1/2-mandatory-errors/3.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const last4Digits = cardNumber.slice(-4);
// 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
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
4 changes: 2 additions & 2 deletions Sprint-1/2-mandatory-errors/4.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
const 12HourClockTime = "20:53";
const 24hourClockTime = "08:53";
const hour12ClockTime = "20:53"; // Changed to start with a letter
const hour24ClockTime = "08:53"; // Also changed for consistency
24 changes: 2 additions & 22 deletions Sprint-1/3-mandatory-interpret/1-percentage-change.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,2 @@
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?
// 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
2 changes: 1 addition & 1 deletion Sprint-1/3-mandatory-interpret/2-time-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ console.log(result);

// 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
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
16 changes: 15 additions & 1 deletion Sprint-1/3-mandatory-interpret/3-to-pounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,18 @@ console.log(`£${pounds}.${pence}`);
// 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"
// 1. const penceString = "399p": initialize a string variable with the value "399p"

// 3. const penceStringWithoutTrailingP = penceString.substring(0, penceString.length -1);
// cleaning the trailing P character. it uses the string´s length minus 1 as the end index for substring(), this leave only the numeric value while drop the last character.

// 8. const paddedPenceNumberString = penceStringWithoutTrailingP.padStar(3, "0"); Padding- ensure the numeric string is at least three characters long by prepending zeros.
// this is important for separating pounds from pence especially when values is less than 100p

// 9. const pounds = paddedPenceNumberString.substring(0, paddedPenceNumberString.length - 2); Extracting pounds component, this uses substring()
// to take all character from the start (index 0) up to, but not including the last two characters, they are always pence.

// 14. const pence = paddedPenceNumberString.substring(paddedPenceNumberString.length - 2).padEnd(2, "0"); Extracting and formatting price-
// Extracts the pence component (the last two digits) and ensures they are always two digits long by padding the end with a zero if needed (though not needed for "99").

// 18. console.log(\£${pounds}.${pence}`);` Output: Format the extracted components into the standard currency display £3.99.
2 changes: 1 addition & 1 deletion Sprint-1/4-stretch-explore/chrome.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ 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`?
What is the return value of `prompt`?
2 changes: 1 addition & 1 deletion Sprint-1/4-stretch-explore/objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ 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?
What does the syntax `console.log` or `console.assert` mean? In particular, what does the `.` mean?
2 changes: 1 addition & 1 deletion Sprint-2/1-key-errors/0.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ function capitalise(str) {
}

// =============> write your explanation here
// =============> write your new code here
// =============> write your new code here
2 changes: 1 addition & 1 deletion Sprint-2/1-key-errors/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ console.log(decimalNumber);
// =============> write your explanation here

// Finally, correct the code to fix the problem
// =============> write your new code here
// =============> write your new code here
20 changes: 7 additions & 13 deletions Sprint-2/1-key-errors/2.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
// Predict and explain first...

// Predict and explain first BEFORE you run any code...
// =============> write your prediction here

// 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;
function multiply(a, b) {
console.log(a * b);
}

// =============> write the error message here
console.log(`The result of multiplying 10 and 32 is ${multiply(10, 32)}`);

// =============> explain this error message here
// =============> write your explanation here

// Finally, correct the code to fix the problem

// =============> write your new code here


// =============> write your new code here
2 changes: 1 addition & 1 deletion Sprint-2/2-mandatory-debug/1.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ 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
// =============> write your new code here
2 changes: 1 addition & 1 deletion Sprint-2/2-mandatory-debug/2.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ console.log(`The last digit of 806 is ${getLastDigit(806)}`);
// =============> 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
// Explain why getLastDigit is not working properly - correct the problem
4 changes: 2 additions & 2 deletions Sprint-2/3-mandatory-implement/1-bmi.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// 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.
// 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

Expand All @@ -15,5 +15,5 @@
// 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 the BMI of someone based off their weight and height
}
2 changes: 1 addition & 1 deletion Sprint-2/3-mandatory-implement/2-cases.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@

// 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
// This might help https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase
2 changes: 1 addition & 1 deletion Sprint-2/3-mandatory-implement/3-to-pounds.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
// 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
// You should call this function a number of times to check it works for different inputs
4 changes: 2 additions & 2 deletions Sprint-2/4-mandatory-interpret/time-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function formatTimeDisplay(seconds) {
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
// You will need to play computer with this example - use the Python Visualizer https://pythontutor.com/visualize.html#mode=edit
// to help you answer these questions

// Questions
Expand All @@ -31,4 +31,4 @@ function formatTimeDisplay(seconds) {
// =============> 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
// =============> write your answer here
2 changes: 1 addition & 1 deletion Sprint-2/5-stretch-extend/format-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const targetOutput2 = "11:00 pm";
console.assert(
currentOutput2 === targetOutput2,
`current output: ${currentOutput2}, target output: ${targetOutput2}`
);
);
6 changes: 3 additions & 3 deletions Sprint-3/1-key-implement/1-get-angle-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
// 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
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
Expand Down Expand Up @@ -53,4 +53,4 @@ const obtuse = getAngleType(120);
// 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
// ====> write your test here, and then add a line to pass the test in the function above
2 changes: 2 additions & 0 deletions Sprint-3/1-key-implement/2-is-proper-fraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,5 @@ const equalFraction = isProperFraction(3, 3);

// Stretch:
// What other scenarios could you test for?


2 changes: 2 additions & 0 deletions Sprint-3/1-key-implement/3-get-card-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ const fiveofHearts = getCardValue("5♥");
// 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."


18 changes: 13 additions & 5 deletions Sprint-3/2-mandatory-rewrite/1-get-angle-type.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
function getAngleType(angle) {
if (angle === 90) return "Right angle";
// replace with your completed function from key-implement

if (angle < 90) return "Acute angle";
if (angle > 90 && angle < 180) return "Obtuse angle";
if (angle === 180) return "Straight angle";
if (angle > 180 && angle < 360) return "Reflex angle";
}


// Don't get bogged down in this detail
// Jest uses Common JS 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;
// 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;
module.exports = getAngleType;

18 changes: 18 additions & 0 deletions Sprint-3/2-mandatory-rewrite/1-get-angle-type.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,33 @@ test("should identify right angle (90°)", () => {
// Case 2: Identify Acute Angles:
// When the angle is less than 90 degrees,
// Then the function should return "Acute angle"
test("should identify acute angle (<90°)", () => {
expect(getAngleType(45)).toEqual("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"
test("should identify obtuse angle (>90° and <180°)", () => {
expect(getAngleType(120)).toEqual("Obtuse angle");
});

// Case 4: Identify Straight Angles:
// When the angle is exactly 180 degrees,
// Then the function should return "Straight angle"
test("should identify straight angle (180°)", () => {
expect(getAngleType(180)).toEqual("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"
test("should identify reflex angle (>180° and <360°)", () => {
expect(getAngleType(270)).toEqual("Reflex angle");
});





7 changes: 6 additions & 1 deletion Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
function isProperFraction(numerator, denominator) {
if (numerator < denominator) return true;
// add your completed function from key-implement here
if (numerator > denominator) return false;
if (numerator <= 0 || denominator <= 0) return false;
if (numerator === denominator) return false;
return false;

}

module.exports = isProperFraction;
module.exports = isProperFraction;
14 changes: 13 additions & 1 deletion Sprint-3/2-mandatory-rewrite/2-is-proper-fraction.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,20 @@ test("should return true for a proper fraction", () => {
expect(isProperFraction(2, 3)).toEqual(true);
});

// Case 2: Identify Improper Fractions:
// Case 2: Identify Improper Fractions:
test("should return false for an improper fraction", () => {
expect(isProperFraction(5, 4)).toEqual(false);
});



// Case 3: Identify Negative Fractions:
test("should return false for a negative fraction", () => {
expect(isProperFraction(-2, 3)).toEqual(true);
});


// Case 4: Identify Equal Numerator and Denominator:
test("should return false when numerator equals denominator", () => {
expect(isProperFraction(4, 4)).toEqual(false);
});
Loading