Skip to content

Commit 9337966

Browse files
authored
Merge pull request #36 from CodeYourFuture/sprint1-exercise-fixes
Fixes and clarifications to sprint 1 exercises
2 parents fd47e0c + 338777e commit 9337966

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Sprint-1/errors/3.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ 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
6-
// Make and explain a prediction about why the code won't work
6+
// Before running the code, make and explain a prediction about why the code won't work
7+
// Then run the code and see what error it gives.
8+
// Consider: Why does it give this error? Is this what I predicted? If not, what's different?
79
// Then try updating the expression last4Digits is assigned to, in order to get the correct value

Sprint-1/exercises/decimal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const num = 58.4567;
1+
const num = 56.4567;
22

33
// You should look up Math functions for this exercise https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math
44

Sprint-1/exercises/initials.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ let firstName = "Creola";
22
let middleName = "Katherine";
33
let lastName = "Johnson";
44

5-
// Declare a variable called initials that stores the first 3 characters of each string in upper case
6-
// Log the variable in each case
5+
// Declare a variable called initials that stores the first character of each string.
6+
// This should produce the string "CKJ", but you must not write the characters C, K, or J in the code of your solution.

Sprint-1/exercises/random.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ const num = Math.floor(Math.random() * (maximum - minimum + 1)) + minimum;
66
// In this exercise, you will need to work out what num represents?
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
9-
// Try logging the value of num several times to build an idea of what the program is doing
9+
// Try logging the value of num and running the program several times to build an idea of what the program is doing

Sprint-1/interpret/time-format.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ const totalMinutes = (movieLength - remainingSeconds) / 60;
66
const remainingMinutes = totalMinutes % 60;
77
const totalHours = (totalMinutes - remainingMinutes) / 60;
88

9-
const remainingHours = totalHours % 24;
10-
11-
const result = `${remainingHours}:${remainingMinutes}:${remainingSeconds}`;
9+
const result = `${totalHours}:${remainingMinutes}:${remainingSeconds}`;
1210
console.log(result);
1311

1412
// For the piece of code above, read the code and then answer the following questions

0 commit comments

Comments
 (0)