Skip to content

Commit 1c37d58

Browse files
Deleted the changes of the sprint one file to meet the mata Data validation
1 parent 2eaa851 commit 1c37d58

File tree

14 files changed

+16
-89
lines changed

14 files changed

+16
-89
lines changed

Sprint-1/1-key-exercises/1-count.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ count = count + 1;
44

55
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
66
// Describe what line 3 is doing, in particular focus on what = is doing
7-
8-
// Line 3 is an assignment where = is an assignment operator and in there we are adding value of 1 to the count variable

Sprint-1/1-key-exercises/2-initials.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ let lastName = "Johnson";
66
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.
77

88
let initials = ``;
9-
console.log(`the initials is ${firstName.charAt(0)}, ${middleName.charAt(0), lastName.charAt(0)}`);
109

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

Sprint-1/1-key-exercises/3-paths.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ const base = filePath.slice(lastSlashIndex + 1);
1515
console.log(`The base part of ${filePath} is ${base}`);
1616

1717
// Create a variable to store the dir part of the filePath variable
18-
// Create a variable to store the ext part of the variable
18+
// Create a variable to store the ext part of the variable
1919

20-
const dir = filePath.slice(0, lastSlashIndex);
21-
const ext = filePath.slice(filePath.lastIndexOf("."));
20+
const dir = ;
21+
const ext = ;
2222

23-
24-
// https://www.google.com/search?q=slice+mdn
23+
// https://www.google.com/search?q=slice+mdn

Sprint-1/1-key-exercises/4-random.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,3 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
77
// Try breaking down the expression and using documentation to explain what it means
88
// It will help to think about the order in which expressions are evaluated
99
// Try logging the value of num and running the program several times to build an idea of what the program is doing
10-
11-
// math.floor will make the number as a whole and remove any decimals or more likely to round the the nearest whole number
12-
// math.random will generate a random number from 0 to 1 but not 1
13-
// (maximum - minimum + 1) provide a range of generated random number
14-
// num is a random whole number between 1 and 100
15-
16-
console.log(num);

Sprint-1/2-mandatory-errors/0.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
//This is just an instruction for the first activity - but it is just for human consumption
2-
//We don't want the computer to run these 2 lines - how can we solve this problem?
1+
This is just an instruction for the first activity - but it is just for human consumption
2+
We don't want the computer to run these 2 lines - how can we solve this problem?

Sprint-1/2-mandatory-errors/1.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// trying to create an age variable and then reassign the value by 1
22

3-
let age = 33;
3+
const age = 33;
44
age = age + 1;

Sprint-1/2-mandatory-errors/2.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// Currently trying to print the string "I was born in Bolton" but it isn't working...
22
// what's the error ?
33

4-
const cityOfBirth = "Bolton";
54
console.log(`I was born in ${cityOfBirth}`);
6-
//const cityOfBirth = "Bolton";
7-
8-
// the error is that cityOfBirth varaible declared after the logging command
5+
const cityOfBirth = "Bolton";

Sprint-1/2-mandatory-errors/3.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
const cardNumber = 4533787178994213;
2-
//const last4Digits = cardNumber.slice(-4);
2+
const last4Digits = cardNumber.slice(-4);
33

44
// The last4Digits variable should store the last 4 digits of cardNumber
55
// However, the code isn't working
66
// Before running the code, make and explain a prediction about why the code won't work
77
// Then run the code and see what error it gives.
88
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
99
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
10-
11-
// I predicted the last four digits bit it has to be a string in order to use the method slice and that explain why it wasn't working
12-
const last4Digits = cardNumber.toString.slice(-4);

Sprint-1/2-mandatory-errors/4.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
const twelveHourClockTime = "20:53";
2-
const twentyFourHourClockTime = "08:53";
1+
const 12HourClockTime = "20:53";
2+
const 24hourClockTime = "08:53";

Sprint-1/3-mandatory-interpret/1-percentage-change.js

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ let carPrice = "10,000";
22
let priceAfterOneYear = "8,543";
33

44
carPrice = Number(carPrice.replaceAll(",", ""));
5-
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ,""));
5+
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""));
66

77
const priceDifference = carPrice - priceAfterOneYear;
88
const percentageChange = (priceDifference / carPrice) * 100;
@@ -12,27 +12,11 @@ console.log(`The percentage change is ${percentageChange}`);
1212
// Read the code and then answer the questions below
1313

1414
// a) How many function calls are there in this file? Write down all the lines where a function call is made
15-
//1-carPrice.replaceAll(",", "") in line 4
16-
//3-number(...) in line 4 - enumerate the first result of replaceAll
17-
//2-priceAfterOneYear.replaceAll("," ,"")) in line 5
18-
//4-number(...) in line 5 - enumerate the second result of replaceAll
19-
//5-console.log(..) - line 9
20-
2115

2216
// 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?
23-
// the error is : a syntax error coming from the missing comma in line 5 between the arguments
24-
25-
2617

2718
// c) Identify all the lines that are variable reassignment statements
28-
// const priceDifference = carPrice - priceAfterOneYear; Line 7
29-
// const percentageChange = (priceDifference / carPrice) * 100; Line 8
3019

3120
// d) Identify all the lines that are variable declarations
32-
// carPrice = Number(carPrice.replaceAll(",", "")); Line 4
33-
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll(",", "")); Line 5
3421

3522
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
36-
// the number function convert the enumerate a string to a number and the method replaceAll replace ever comma with a space
37-
// the purpose is to clean the value so that it can be converted to a proper number using Number().
38-

0 commit comments

Comments
 (0)