Skip to content

Commit 5f24463

Browse files
committed
modified the answer format on 1-key-exercies 1- count.
1 parent a0cad5a commit 5f24463

8 files changed

Lines changed: 40 additions & 2 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ count = count + 1;
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
77

8-
//= mean assignment operator. Computer will calculate the result of "count + 1" and update the variable with the result.
9-
//In this question, variable "count" changed from 0 to 1.
8+
= mean assignment operator. Computer will calculate the result of "count + 1" and update the variable with the result.
9+
In this question, variable "count" changed from 0 to 1.

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ 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+
console.log(num)

‎Sprint-2/prep/PasswordChecker.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const password = "secretword123";
2+
const userInput = "thisiswrong";
3+
const adminPassword = "override";
4+
let response = "";
5+
6+
if (userInput === password){
7+
response = "Correct password entered";
8+
} else if (userInput === adminPassword){
9+
response = "Admin access granted";
10+
} else {
11+
response = "Incorrect password!";
12+
}
13+
14+
console.log(response);

‎Sprint-2/prep/comparison.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log(42 === 42);

‎Sprint-2/prep/errors.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const password = "secretword123";
2+
const userInput = "thisiswrong";
3+
const adminPassword = "override";
4+
const response = "";
5+
6+
if (userInput === password){
7+
response = "Correct password entered";
8+
} else if (userInput === adminPassword){
9+
response = "Admin access granted";
10+
} else {
11+
response = "Incorrect password!";
12+
}
13+
14+
console.log(response);

‎Sprint-2/prep/fact.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("I am from Hong Kong.");

‎Sprint-2/prep/greeting.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
2+
const name="Roger!";
3+
let greeting = "hello!";
4+
greeting = "Goodbye!"
5+
console.log(`${greeting}, ${name}`);

‎Sprint-2/prep/hello_world.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log("oh my god1")

0 commit comments

Comments
 (0)