Skip to content

Commit b12ecb1

Browse files
committed
changes to review
1 parent e401a84 commit b12ecb1

File tree

8 files changed

+14
-9
lines changed

8 files changed

+14
-9
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ count = count + 1;
77

88
// Line 1 is a variable declaration, creating the count variable with an initial value of 0
99
// Describe what line 3 is doing, in particular focus on what = is doing
10-
//It takes the current value of count, add 1 to it
10+
//It takes the current value of count, add 1 to it
11+
//The one-word programming term is increment.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ let lastName = "Johnson";
55
// Declare a variable called initials that stores the first character of each string.
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

8-
let initials = `${firstName.charAt()}${middleName.charAt()}${lastName.charAt()} `;
8+
let initials = `${firstName.charAt(0)}${middleName.charAt(0)}${lastName.charAt(0)} `;
99
console.log(initials)
1010

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

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@ console.log(num)
88
// Try breaking down the expression and using documentation to explain what it means
99
// It will help to think about the order in which expressions are evaluated
1010
// Try logging the value of num and running the program several times to build an idea of what the program is doing
11-
//results: 4,23,91,46 the program is giving you a random number while math.random give you a random decimal number math.floor rounds the total number up
11+
//results: 4,23,91,46 the program is giving you a random number while math.random give you a random decimal number math.floor rounds the total number up
12+
// 1. Math.random() - should produce random decimal number [0,1)
13+
// 2. Math.random() * (maximum - minimum + 1) - should produce [0,1) * (100-1+1)
14+
// 3. Math.floor(Math.random() * (maximum - minimum + 1)) - Math.floor() rounds down to the nearest integer so it won't be 88.88 but just 88
15+
// 4. Math.floor(Math.random() * (maximum - minimum + 1)) + minimum - adds minumin to have an integer between 1 and 100 inclusive. [0,100]

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//answer
55

6-
const HourClockTime24 = "20:53";
6+
const hourClockTime24 = "20:53";
77
const hourClockTime12 = "08:53";
88

99
// you can't start a parameter with the number, also the values did not match logically to the parameter

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ 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-
//4,5,11
15+
//4,5,10 (five)
1616
// 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?
1717
//line 5, added come before ""
1818
// c) Identify all the lines that are variable reassignment statements

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ console.log(result);
2020
//The remainder (%) operator returns the remainder left over when one operand is divided by a second operand. It always takes the sign of the dividend.
2121

2222
// d) Interpret line 4, what does the expression assigned to totalMinutes mean?
23-
//math expression
23+
//The total number of whole minutes in the movie
2424
// e) What do you think the variable result represents? Can you think of a better name for this variable?
25-
//maybe timeLeft or similar
25+
//timeInHMS
2626
// f) Try experimenting with different values of movieLength. Will this code work for all values of movieLength? Explain your answer
2727
//

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const pounds = paddedPenceNumberString.substring(
1414
//4. Extracts everything except the last 2 digits of paddedPenceNumberString
1515
const pence = paddedPenceNumberString
1616
.substring(paddedPenceNumberString.length - 2)
17-
.padEnd(2, "0");
17+
// .padEnd(2, "0");
1818
//5. takes the last 2 digits as the pence from paddedPenceNumberString
1919
console.log(${pounds}.${pence}`);
2020
//6. Prints the formatted pounds-and-pence value

Sprint-1/4-stretch-explore/chrome.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ What effect does calling the `alert` function have?
1515
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`.
1616
//shows a pop-up to enter a name / stores and shows name
1717
What effect does calling the `prompt` function have? //shows pop-up form
18-
What is the return value of `prompt`? //if myName is set returns myName value
18+
What is the return value of `prompt`? //if myName is set returns myName value (It returns the text that the user types into the input box.)

0 commit comments

Comments
 (0)