diff --git a/Week2/homework/index.html b/Week2/homework/index.html new file mode 100644 index 000000000..c94fe1ed0 --- /dev/null +++ b/Week2/homework/index.html @@ -0,0 +1,18 @@ + + + + + Codestin Search App + + + + + + + + + + + + + diff --git a/Week2/homework/maartjes_work.js b/Week2/homework/maartjes_work.js index 0b451d122..fbbefee4b 100644 --- a/Week2/homework/maartjes_work.js +++ b/Week2/homework/maartjes_work.js @@ -1,47 +1,57 @@ 'use strict'; -const monday = [ - { - name: 'Write a summary HTML/CSS', - duration: 180 - }, - { - name: 'Some web development', - duration: 120 - }, - { - name: 'Fix homework for class10', - duration: 20 - }, - { - name: 'Talk to a lot of people', - duration: 200 - } +const monday = [{ + name: 'Write a summary HTML/CSS', + duration: 180 + }, + { + name: 'Some web development', + duration: 120 + }, + { + name: 'Fix homework for class10', + duration: 20 + }, + { + name: 'Talk to a lot of people', + duration: 200 + } ]; -const tuesday = [ - { - name: 'Keep writing summary', - duration: 240 - }, - { - name: 'Some more web development', - duration: 180 - }, - { - name: 'Staring out the window', - duration: 10 - }, - { - name: 'Talk to a lot of people', - duration: 200 - }, - { - name: 'Look at application assignments new students', - duration: 40 - } +const tuesday = [{ + name: 'Keep writing summary', + duration: 240 + }, + { + name: 'Some more web development', + duration: 180 + }, + { + name: 'Staring out the window', + duration: 10 + }, + { + name: 'Talk to a lot of people', + duration: 200 + }, + { + name: 'Look at application assignments new students', + duration: 40 + } ]; -const tasks = monday.concat(tuesday); +const tasks = monday.concat(tuesday) +let minutesToHours = tasks.filter(a => a.duration >= 120).map(h => h.duration / 60); -// Add your code here +console.log(minutesToHours); + +let perHour = minutesToHours.map(v => v * 23) // per hour 23 euro + +console.log(perHour); + +let total = perHour.reduce(function(a, b) { + return a + b; + +}); +total = total.toFixed(2); //rounding number +console.log("Maartje totally will earn: " + total + " Euro"); \ No newline at end of file diff --git a/Week2/homework/map_filter.js b/Week2/homework/map_filter.js index b6af22631..09c1b264b 100644 --- a/Week2/homework/map_filter.js +++ b/Week2/homework/map_filter.js @@ -2,4 +2,7 @@ const numbers = [1, 2, 3, 4]; -// Add your code here + +const newNumbers = numbers.filter(w => w % 2 !== 0).map(x => x * 2); + +console.log('The doubled numbers are: ' + newNumbers); \ No newline at end of file