Skip to content

Commit 9078d72

Browse files
committed
changed the // to /* */
1 parent 1540cdc commit 9078d72

5 files changed

Lines changed: 40 additions & 30 deletions

File tree

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

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

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@ const cardNumber = "4533787178994213";
22
const last4Digits = cardNumber.slice(-4);
33
console.log (last4Digits)
44

5-
// The last4Digits variable should store the last 4 digits of cardNumber
6-
// However, the code isn't working
7-
// Before running the code, make and explain a prediction about why the code won't work
8-
// Then run the code and see what error it gives.
9-
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
10-
// Then try updating the expression last4Digits is assigned to, in order to get the correct value
11-
// I firsth thought the -4 would not work as it starts on 0
12-
// I then recalled the code wont work as the cardNumber is a number and not a string, it needs to be a string for the .slice to work.
5+
/*
6+
The last4Digits variable should store the last 4 digits of cardNumber
7+
However, the code isn't working
8+
Before running the code, make and explain a prediction about why the code won't work
9+
Then run the code and see what error it gives.
10+
Consider: Why does it give this error? Is this what I predicted? If not, what's different?
11+
Then try updating the expression last4Digits is assigned to, in order to get the correct value
12+
I firsth thought the -4 would not work as it starts on 0
13+
I then recalled the code wont work as the cardNumber is a number and not a string, it needs to be a string for the .slice to work.
14+
*/

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,12 @@ console.log(`The percentage change is ${percentageChange}`);
2121

2222
// e) Describe what the expression Number(carPrice.replaceAll(",","")) is doing - what is the purpose of this expression?
2323

24-
// a) There are 5 calls made:
25-
// carPrice = Number(carPrice.replaceAll(",", ""));
26-
// priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""))
27-
// b) Error on line 5 for "," it is missing the seperating , between "," and "".
28-
// c) 4 and 5
29-
// d) 1 and 2, 7 and 8,
30-
// e) It removes the , from the string and replaces it with nothing. Used to help change the string into a number with the "Number" function.
24+
/*
25+
a) There are 5 calls made:
26+
carPrice = Number(carPrice.replaceAll(",", ""));
27+
priceAfterOneYear = Number(priceAfterOneYear.replaceAll("," ""))
28+
b) Error on line 5 for "," it is missing the seperating , between "," and "".
29+
c) 4 and 5
30+
d) 1 and 2, 7 and 8,
31+
e) It removes the , from the string and replaces it with nothing. Used to help change the string into a number with the "Number" function.
32+
*/

Sprint-1/3-mandatory-interpret/2-time-format.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ console.log(result);
2424

2525
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
2626

27-
// a) There are 6: movieLength, remainingSeconds, totalMinutes, remainingMinutes, totalHours, result.
28-
// b) There is one: console.log.
29-
// c) It is taking the movieLength and doing a remainder that is showing what is left after the vaule has been divided, in this case wil be 84.
30-
// I found the info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
31-
// d) It is removing any extra seconds from the division by 60 so that is is showing as whole numbers without decimals.
32-
// e) Result is showing the movies duration but broken down to hours:minutes:seconds, I think it should be movieDuration to help describe it better.
33-
// f) Yes, it does work to show the lenght even if it is only in one section, though it does show values of 0, could clean it up to show nothing.
27+
/*
28+
a) There are 6: movieLength, remainingSeconds, totalMinutes, remainingMinutes, totalHours, result.
29+
b) There is one: console.log.
30+
c) It is taking the movieLength and doing a remainder that is showing what is left after the vaule has been divided, in this case wil be 84.
31+
I found the info here https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder
32+
d) It is removing any extra seconds from the division by 60 so that is is showing as whole numbers without decimals.
33+
e) Result is showing the movies duration but broken down to hours:minutes:seconds, I think it should be movieDuration to help describe it better.
34+
f) Yes, it does work to show the lenght even if it is only in one section, though it does show values of 0, could clean it up to show nothing.
35+
*/

Sprint-1/3-mandatory-interpret/3-to-pounds.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,11 @@ console.log(`£${pounds}.${pence}`);
2525

2626
// To begin, we can start with
2727
// 1. const penceString = "399p": initialises a string variable with the value "399p"
28-
// 3-6. It is taking the vaule from pencestring and using substring to return part of the string, by -1 so from the end resualting in "399"
29-
// 8. It is now adding "0" infront of vaule if the vaule is under 3 characters in size.
30-
// 9-12. Using the substring function to reduce the size of the vaule to just 2 characters.
31-
// 14-16. Taking the value from paddedPenceNumberString and this time with substring, only showing the last 2 characters in teh value.
32-
// Then with using .padEnd it ensures that 2 characters are shown with 0 being there is nothing is there.
33-
// 18. Showing the resualt of the code starting with a "£" then the value of "pounds" then a "." and lastly value of "pence"
28+
/*
29+
3-6. It is taking the vaule from pencestring and using substring to return part of the string, by -1 so from the end resualting in "399"
30+
8. It is now adding "0" infront of vaule if the vaule is under 3 characters in size.
31+
9-12. Using the substring function to reduce the size of the vaule to just 2 characters.
32+
14-16. Taking the value from paddedPenceNumberString and this time with substring, only showing the last 2 characters in teh value.
33+
Then with using .padEnd it ensures that 2 characters are shown with 0 being there is nothing is there.
34+
18. howing the resualt of the code starting with a "£" then the value of "pounds" then a "." and lastly value of "pence"
35+
*/

0 commit comments

Comments
 (0)