Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cfb702

Browse files
committed
finished planningclass12
1 parent 2a37d2e commit 1cfb702

File tree

5 files changed

+74
-114
lines changed

5 files changed

+74
-114
lines changed

Week1/MAKEME.md

Lines changed: 39 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,16 @@ console.log('I'm awesome');
7272
```
7373
2\.1 Copy the code in your `.js` file and run it. You will see that you will get a SyntaxError. Find a solution for this error, Hint read the error message carefully, it also gives an indication of where the problem is.
7474

75-
3\. Declare a variable `x` and initialize it with an integer.
76-
77-
3\.1 First, _declare_ your variable `x`.
78-
75+
3\. Declare a variable `x` and initialize it with an integer.
76+
3\.1 First, _declare_ your variable `x`.
7977
3\.2 Add a console.log statement that explains that explains in words what _you think_ the value of `x` is, like in this example:
8078
```js
8179
// TODO -> here you initialize your variable
8280
console.log('the value of my variable x will be: whateverYouThinkItWillLog');
8381
```
84-
3\.3 Add a console.log statement that logs the value of `x`
85-
86-
3\.4 Now _initialize_ your variable `x` with an integer
87-
88-
3\.5 Now add a console.log statement that explains what _you think_ the value of `x` is.
89-
82+
3\.3 Add a console.log statement that logs the value of `x`.
83+
3\.4 Now _initialize_ your variable `x` with an integer.
84+
3\.5 Now add a console.log statement that explains what _you think_ the value of `x` is.
9085
3\.6 Add a console.log statement that logs the value of `x`.
9186
Steps to be taken:
9287

@@ -100,16 +95,11 @@ console.log('I'm awesome');
10095
```
10196

10297
4\. Declare a variable `y` and assign a string to it.
103-
104-
4\.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is
105-
106-
4\.2 Now console.log the variable `y`.
107-
108-
4\.3 Now assign a new string to the variable `y`
109-
110-
4\.4 Just like you did before write a console.log statement that explains in words what you think will be logged to the console.
111-
112-
4\.5 Now console.log `y` again.
98+
4\.1 Write a console.log statement in which you explain in words what _you think_ the value of the string is.
99+
4\.2 Now console.log the variable `y`.
100+
4\.3 Now assign a new string to the variable `y`.
101+
4\.4 Just like you did before write a console.log statement that explains in words what you think will be logged to the console.
102+
4\.5 Now console.log `y` again.
113103
```js
114104
// TODO -> here you declare AND assign your string
115105
console.log('the value of my string will be: whateverYouThinkItWillLog');
@@ -120,61 +110,39 @@ console.log('I'm awesome');
120110
```
121111

122112
5\. How do you round the number 7.25, to the nearest integer?
123-
124-
5\.1 Declare a variable `z` and assign the number 7.25 to it.
125-
126-
5\.2 Console.log `z`.
127-
128-
5\.3 Declare another variable `a` that has the value of z but rounded to the nearest integer.
129-
130-
5\.4 Console.log `a`
131-
132-
5\.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
133-
134-
5\.6 Console.log the highest value.
113+
5\.1 Declare a variable `z` and assign the number 7.25 to it.
114+
5\.2 Console.log `z`.
115+
5\.3 Declare another variable `a` that has the value of z but rounded to the nearest integer.
116+
5\.4 Console.log `a`.
117+
5\.5 So now we have `z` and `a` find a way to compare the two values and store the highest of the two in a new variable.
118+
5\.6 Console.log the highest value.
135119

136120
6\. Arrays!
137-
138-
6\.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
139-
140-
6\.2 Write a console.log statement that explains in words what you think the value of the array is.
141-
142-
6\.3 Console.log your array.
143-
144-
6\.4 Create an array that has your favorite animals inside
145-
146-
6\.5 Log your array
147-
148-
6\.6 Add a statement that adds Daan's favorite animal (baby pig) to the *existing array*
149-
150-
6\.7 Log your new array!
151-
152-
7\. More strings
153-
154-
7\.1 Let's consider the following string: `let myString = "this,is,a,test"`.
155-
156-
7\.2 Add the string to your file and console.log it.
157-
158-
7\.3 Find a way to get the length of `myString`.
159-
160-
7\.4 Console.log the length of `myString`.
121+
6\.1 Declare an empty array (you can decide on how to call it yourself, but read on a bit here and see if you can find a good name that exactly describes what this variable will hold).
122+
6\.2 Write a console.log statement that explains in words what you think the value of the array is.
123+
6\.3 Console.log your array.
124+
6\.4 Create an array that has your favorite animals inside.
125+
6\.5 Log your array.
126+
6\.6 Add a statement that adds Daan's favorite animal (baby pig) to the *existing array*.
127+
6\.7 Log your new array!
128+
129+
7\. More strings
130+
7\.1 Let's consider the following string: `let myString = "this,is,a,test"`.
131+
7\.2 Add the string to your file and console.log it.
132+
7\.3 Find a way to get the length of `myString`.
133+
7\.4 Console.log the length of `myString`.
161134

162135
8\. Write a program that checks the types of two variables and prints out `SAME TYPE` if they are the same type.
163-
164-
8\.1 First declare at least four variables and assign them different data types.
165-
166-
8\.2 For each variable write a `console.log` statement that logs the value
136+
8\.1 First declare at least four variables and assign them different data types.
137+
8\.2 For each variable write a `console.log` statement that logs the value
167138
```js
168139
let foo = 3;
169140
console.log('The value of my variable foo is: ' + foo);
170141
```
171-
8\.3 Now write a console.log statement wherein you first explain in words what you think the _type_ of your variables is.
172-
173-
8\.4 Now use `typeof` to log the actual _type_ of your variables.
174-
175-
8\.5 Now compare the types of your different variables with one another.
176-
177-
8\.6 Make sure to also show a message when the variables you are comparing are not the same type.
142+
8\.3 Now write a console.log statement wherein you first explain in words what you think the _type_ of your variables is.
143+
8\.4 Now use `typeof` to log the actual _type_ of your variables.
144+
8\.5 Now compare the types of your different variables with one another.
145+
8\.6 Make sure to also show a message when the variables you are comparing are not the same type.
178146

179147
For example:
180148

@@ -189,16 +157,12 @@ if () {
189157
```
190158

191159
9\. If `x` equals 7, and the only other statement is `x = x % 3`, what would be the new value of `x`?
192-
193-
9\.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
160+
9\.1 Add at least 3 `console.log` statements in which you show that you understand what `%` does.
194161

195162
10\. Write a program to answer the following questions:
196-
197-
10\.1 Can you store multiple types in an array? Numbers and strings? Make an example that illustrates your answer.
198-
199-
10\.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
200-
201-
10\.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
163+
10\.1 Can you store multiple types in an array? Numbers and strings? Make an example that illustrates your answer.
164+
10\.2 Can you compare infinities? (Not in Eyad's world) - does 6/0 === 10/0? How can you test this?
165+
10\.3 Add console.log statements to the above program's in which you show that you understand the concepts (just like you've done in the above assignments).
202166

203167
### Step 4: **Some freeCodeCamp challenges (10 hours):**
204168

Week1/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Please watch the following parts of the course, [Programming Foundations Fundame
2828
- Program structure ~ http://eloquentjavascript.net/02_program_structure.html
2929

3030
### Review
31-
- Go through the review of [week 1](https://github.com/HackYourFuture/JavaScript/blob/master/Week1/REVIEW.md)
32-
- Go through the review of [week 2](https://github.com/HackYourFuture/JavaScript/blob/master/Week2/REVIEW.md)
31+
- Go through the review of [week 1](/Week1/REVIEW.md)
32+
- Go through the review of [week 2](/Week2/REVIEW.md)
3333

3434
_Please go through the material and come to class prepared!_

Week5/MAKEME.md

Lines changed: 21 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -23,31 +23,26 @@ _Deadline Wednesday_
2323

2424
1. Say you would like to write a program that doubles the odd numbers in an array and throws away the even number.
2525

26-
Your solution could be something like this:
27-
```js
28-
let numbers = [1, 2, 3, 4];
29-
let newNumbers = [];
30-
31-
for(let i = 0; i < numbers.length; i++) {
32-
if(numbers[i] % 2 !== 0) {
33-
newNumbers[i] = numbers[i] * 2;
26+
Your solution could be something like this:
27+
```js
28+
let numbers = [1, 2, 3, 4];
29+
let newNumbers = [];
30+
31+
for(let i = 0; i < numbers.length; i++) {
32+
if(numbers[i] % 2 !== 0) {
33+
newNumbers.push(numbers[i] * 2);
34+
}
3435
}
35-
}
3636

37-
console.log("The doubled numbers are", newNumbers); // [2, 6]
37+
console.log("The doubled numbers are", newNumbers); // [2, 6]
3838

39-
```
39+
```
4040

41-
rewrite the above program using `map` and `filter` don't forget to use `=>`
41+
Rewrite the above program using `map` and `filter` don't forget to use `=>`
4242
43-
2. Use the array of the previous assignment, write a program that add the even numbers to the resulting array twice, but the odd numbers only once. Don't forget to use `=>`.
44-
45-
Your output should be:
46-
```js
47-
console.log("The final numbers are", newNumbers);// [1, 2, 2, 3, 4, 4]
48-
```
4943
5044
Underneath you see a very interesting small insight in Maartje's work:
45+
5146
```js
5247
let monday = [
5348
{
@@ -67,10 +62,10 @@ let monday = [
6762
duration : 200
6863
}
6964
];
70-
65+
7166
let tuesday = [
7267
{
73-
name : 'Keep writing summery',
68+
name : 'Keep writing summary',
7469
duration : 240
7570
},
7671
{
@@ -90,17 +85,16 @@ let tuesday = [
9085
duration : 40
9186
}
9287
];
93-
94-
let tasks = [monday, tuesday];
88+
89+
let tasks = monday.concat(tuesday);
9590
```
9691

97-
3. Write a program that does the following:
92+
2. Write a program that does the following below. Use `map` and `filter`. You will also need a `forEach` or a `for` loop for the 'summing up' part.
9893

9994
- Collect two days' worth of tasks.
10095
- Convert the task durations to hours, instead of minutes.
101-
- Filter out everything that took two hours or more.
102-
- Sum it all up.
103-
- Multiply the result by a per-hour rate for billing (you can decide yourself what Maartje should make per hour).
96+
- Filter out everything that took two hours or more
97+
- Multiply the each duration by a per-hour rate for billing (you can decide yourself what Maartje should make per hour) and sum it all up.
10498
- Output a formatted Euro amount.
10599
- Don't forget to use `=>`
106100

@@ -114,6 +108,7 @@ _Deadline Saturday_
114108

115109
3. [Iterate over Arrays with map](https://www.freecodecamp.com/challenges/iterate-over-arrays-with-map)
116110

111+
117112
### Step 4: Read before next lecture
118113

119114
_Deadline Sunday morning_

Week6/MAKEME.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ _Deadline Monday_
1616

1717
Give feedback on `step 3` of `week 5` to one of your fellow students (do this by creating issues in Github).
1818

19-
### Step 2: JavaScript
19+
## Step 2: Git Homework
20+
21+
[Make these assignments](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md). For handing in homework follow the Forking workflow that is described in our lecture-3.md file of HackYourFuture’s Git repository (there is also a video that explains this).
22+
23+
24+
### Step 3: JavaScript
2025

2126
_Deadline Wednesday_
2227

@@ -100,7 +105,7 @@ If you are confused please run the code and then consult the Google for "javaScr
100105
101106
<!-- Write assignment with more fun API -->
102107
103-
### Step 3: Some more JavaScript
108+
### Step 4: Some more JavaScript
104109
105110
_Deadline Saturday_
106111
@@ -129,7 +134,7 @@ You can see `CommandLine` in the URL. These are called "query parameters" and le
129134
__Bonus__: Write a function takes this array `['a', 'b', 'c', 'd', 'a', 'e', 'f', 'c']` and returns an array which only has unique values in it (so it removes the duplicate ones). Make it a 'smart' algorithm that could do it for every array (only strings/number). Try to make it as fast as possible!
130135
131136
132-
### Step 4: Read before next lecture
137+
### Step 5: Read before next lecture
133138
134139
_Deadline Sunday morning_
135140

Week7/MAKEME.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,21 @@ Topics discussed this week:
99

1010
>[Here](/Week7/README.md) you find the readings you have to complete before the eighth lecture.
1111
12-
## Step 1: Git Homework
13-
14-
[Make these assignments](https://github.com/HackYourFuture/Git/blob/master/Lecture-3.md). For handing in homework follow the Forking workflow that is described in our lecture-3.md file of HackYourFuture’s Git repository (there is also a video that explains this).
15-
16-
## Step 2: Give feedback on Step 3 and 4 of last weeks homework.
12+
## Step 1: Give feedback on Step 3 and 4 of last weeks homework.
1713

1814
Give feedback on the SPA (Github API) and git branching homework of one of you fellow students. Please provide the feedback in an issue.
1915

20-
## Step 3: Issues
16+
## Step 2: Issues
2117

2218
- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE.
2319

2420

25-
### Step 2: Fix issues and API
21+
### Step 3: Fix issues and API
2622

2723
- Fix the issues from the last week and make sure you explain how you fixed the issue in a comment (or commit message)
2824

2925

30-
### Step 3: SPA :sweat_drops:
26+
### Step 4: SPA :sweat_drops:
3127
You are going to write a SPA (Single Page Application) that uses the [Github API](https://developer.github.com/guides/getting-started/). Make sure that your app uses a logical pattern just like [this codepen](http://codepen.io/Razpudding/pen/MmVpeW).
3228

3329
Just like last week:

0 commit comments

Comments
 (0)