Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions Week1/homework/app.js

This file was deleted.

50 changes: 50 additions & 0 deletions Week1/homework/css/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
*{
box-sizing: border-box;
}
body{
background: lightgrey;
margin: 0 auto;
text-align:center;
}
#myList{
width: 80%;
margin: 0 auto;
text-align:center;
}
ol{
display: flex;
flex-wrap:wrap;
margin: 0 auto;
width: 100%;
}
li{
background-color: #0a0a0a;
margin: 1%;
padding: 1%;
width:31.333%;
border-radius:10px;
text-align:center;
list-style: none;
}
img{
width:90%
}
h2{
background-color:#4c4643 ;
color: #ffffff;
font-size: 100%;
font-family:cursive;
margin: 1%;
}
h3{
color: #ffffff;
font-size: 80%;
font-family:monospace;
margin: 1%;
}
p{
color: #ffffff;
font-size: 70%;
font-family:sans-serif;
margin: 1%;
}
Binary file added Week1/homework/img/Blindness.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/Thumbs.db
Binary file not shown.
Binary file added Week1/homework/img/angels_and_demons.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/crime_and_punishment.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/do_not_tell_mommy.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/inferno.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/les_miserables.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/the_bamboo_stalk.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/the_davinci_code.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Week1/homework/img/the_kite_runner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion Week1/homework/index.html
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
<!-- replace this with your HTML content -->
<!doctype html>

<html>
<head>
<title>The Books</title>
<meta charset="UTF-8">
<meta name="viewport" content="initial-scale=1.0">
<link rel="stylesheet" href=css/style.css />
</head>

<body>
<div id="myList"></div>
<script src="js/my_book.js"></script>
</body>
</html>
82 changes: 82 additions & 0 deletions Week1/homework/js/my_book.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*global console*/
'use strict';

var namesBook = [
'the_davinci_code',
'the_kite_runner',
'the_bamboo_stalk',
'do_not_tell_mommy',
'inferno',
'angels_and_demons',
'les_miserables',
'crime_and_punishment',
'blindness',
'the_monk_who_sold_his_ferrari'
];
var ownerBook = [
'Dan Brown',
'Khaled Hosseini',
'Saud Alsanousi',
'Toni Maguire',
'Dan Brown',
'Dan Brown',
'Victor Hugo',
'Fyodor Dostoevsky',
'José Saramago',
'Robin Sharma'
],
titleBook = [
'The Davinci Code',
'The Kite Runner',
'The Bamboo Stalk ',
'Don\'t Tell Mommy',
'inferno',
'Angels And Demons',
'les miserables',
'Crime And Punishment',
'Blindness',
'The monk who sold his ferrari'
];
var i;
var myOl = document.createElement('ol');
document.getElementById('myList').appendChild(myOl);

namesBook.forEach(function() {

var myNewLi = document.createElement('li');
myOl.appendChild(myNewLi);
myNewLi.setAttribute('id', 'li' + i);
});

var myId = namesBook,
auth = ownerBook,
tit = titleBook,
ob = {
idBook: myId,
title: tit,
author: auth,
language: 'English'
};

for (i = 0; i < ownerBook.length; i = i + 1) {
var myH = document.createElement('h2');
var myNewLi = document.getElementsByTagName('li');
myNewLi[i].appendChild(myH);
myH.textContent = titleBook[i];

var myOtherH = document.createElement('h3');
var myNewLi = document.getElementsByTagName('li');
myNewLi[i].appendChild(myOtherH);
myOtherH.textContent = 'By : ' + ownerBook[i];

var myp = document.createElement('p');
var myNewLi = document.getElementsByTagName('li');
myNewLi[i].appendChild(myp);
myp.textContent = 'the language : ' + ob.language;

var myImg = document.createElement('img');
var myNewLi = document.getElementsByTagName('li');
myNewLi[i].appendChild(myImg);
myImg.setAttribute('src', 'img/' + namesBook[i] + '.jpg');
myImg.setAttribute('alt', 'Here is the picture');
}
1 change: 0 additions & 1 deletion Week1/homework/style.css

This file was deleted.

13 changes: 11 additions & 2 deletions Week2/homework/maartjes-work.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,25 @@ const maartjesTasks = monday.concat(tuesday);
const maartjesHourlyRate = 20;

function computeEarnings(tasks, hourlyRate) {
// Replace this comment and the next line with your code
console.log(tasks, hourlyRate);
}

return tasks
.map( hour => hour.duration / 60)
.filter(hour => hour >= 2)
.map (hour => hour * hourlyRate)
.reduce ((x, y) => x + y, 0);





// eslint-disable-next-line no-unused-vars
const earnings = computeEarnings(maartjesTasks, maartjesHourlyRate);

// add code to convert `earnings` to a string rounded to two decimals (euro cents)

console.log(`Maartje has earned €${'replace this string with the earnings rounded to euro cents'}`);
console.log(`Maartje has earned €${earnings.toFixed(2)}`);

// Do not change or remove anything below this line
module.exports = {
Expand Down
6 changes: 3 additions & 3 deletions Week2/homework/map-filter.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
'use strict';

function doubleOddNumbers(numbers) {
// Replace this comment and the next line with your code
console.log(numbers);
numbers = numbers.filter(x => x % 2).map(x => x * 2);
return numbers;
}

const myNumbers = [1, 2, 3, 4];
Expand All @@ -12,4 +12,4 @@ console.log(doubleOddNumbers(myNumbers));
module.exports = {
myNumbers,
doubleOddNumbers
};
};