Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 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
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}`
);
);