diff --git a/README.md b/README.md deleted file mode 100644 index a9a49e4..0000000 --- a/README.md +++ /dev/null @@ -1,93 +0,0 @@ -> If you are following the HackYourFuture curriculum we recommend you to start with module 1: [HTML/CSS/GIT](https://github.com/HackYourFuture/HTML-CSS). To get a complete overview of the HackYourFuture curriculum first, click [here](https://github.com/HackYourFuture/curriculum). - -> Please help us improve and share your feedback! If you find better tutorials -> or links, please share them by [opening a pull request](https://github.com/HackYourFuture/JavaScript/pulls). - -# Module #2 - JavaScript - -![JavaScript](./assets/javascript.png) - -In this module you'll make a start into wonderful world of programming. We will be using the programming language `JavaScript` to do so. You'll learn about the basic building blocks of programming: `loops`, `functions`, `control flow` and more. Consider these as the ABC's of programming, without them it's impossible to write working software! - -You'll be learning two main things: - -1. **Fundamental concepts in programming**. While we're using JavaScript to illustrate these concepts, it's important to keep in mind that what you will learn is applicable to **any** programming language. They might differ in syntax (a fancy term for the arrangement of words in a language in order for it to make sense), but the functionality will be the same: a loop will always be a loop. - -This should be your mindset when you're learning concepts: **I'm learning how to become a software developer that can adjust to any language used, because I know what the underlying principles and concepts are**. - -2. **How to think like a programmer**. In one sentence this means: knowing how to solve problems computationally. Let's split that up in two parts: `how to solve problems` refers to the ability to identify issues and find effective solutions. `computationally` refers to the ability to think in logical steps that the computer can understand and execute. - -This should be your mindset when you're learning how to think : **I'm learning how to think in logical steps, identifying cause and effect, and always looking for solutions**. - -## Before you start! - -### Install some new software! - -In order to test your JavaScript code, you'll be using software that will execute your files from the command line. This software is called [Node.js](https://nodejs.org/en/download/). Download the Long-Term Support (LTS) version for your specific operating system. - -After you've installed it, go to your command line interface. Type in the following command: - -``` -node --version -``` - -It should show you the version you are working with. - -## Learning goals - -In order to successfully complete this module you will need to master the following: - -- Have an idea of what `computer programming` is -- Know the basic building blocks of `JavaScript` -- Correctly write and use `variables`, `functions` and `loops` -- Understand the `control flow` -- Be able to solve worded problems using code - -## How to use this repository - -### Repository content - -This repository consists of 2 essential parts for each week: - -1. `README`: this document contains all the required theory you need to understand **while** working on the weekly assignment. It contains the list of concepts that you will want to study this week and points you to your study book to read all about them. This is the **first thing** you should start with every week -2. `MAKEME`: this document contains the instructions for each week's practical tasks / assignment. Start with the exercises rather quickly, so that you can ground the concepts you read about earlier. In the first two weeks we do not expect you to hand in any assignment as the online resources already check the code automatically, from week 3 our mentors will start giving you feedback on your assignments. - -### How to study - -Let's say you are just starting out with the JavaScript module. This is what you do... - -1. The week always starts on **Wednesday**. First thing you'll do is open the `README.md` for that week. For the first week of `JavaScript`, that would be [Week1 Reading](/Week1/README.md) -2. You spend **Wednesday** and **Thursday** going over the resources and try to get a basic understanding of the concepts. In the meanwhile, you'll also implement any feedback you got on last week's assignment (from the HTML-CSS module) -3. On **Friday** you start with the assignment, found in the `MAKEME.md`. For the first week of `JavaScript`, that would be [Week1 Assignment](/Week1/MAKEME.md) -4. You spend **Friday** and **Saturday** playing around with the exercises and write down any questions you might have. -5. **DEADLINE 1**: You'll submit any questions you might have before **Saturday 23.59**, in the cohort channel. -6. On **Sunday** you'll attend the Q&A session. It'll be of the Q&A format, meaning that there will be no new material. Instead your questions shall be discussed and you can learn from others. -7. You spend **Monday** and **Tuesday** finalizing your assignment. -8. **DEADLINE 2**: You submit your assignment to the right channels (GitHub) before **Tuesday 23.59**. If you can't make it on time, please communicate it with your mentor -9. Start the new week by going back to point 1! - -In summary: - -![Weekflow](assets/weekflow.png) - -To have a more detailed overview of the guidelines, please read [this document](https://docs.google.com/document/d/1JUaEbxMQTyljAPFsWIbbLwwvvIXZ0VCHmCCN8RaeVIc/edit?usp=sharing) or ask your mentor/cohort on Slack! - - -## Planning - -| Week | Topic | Reading Materials | Assignment | -| ---- | ---------------------------------------------------------- | --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| 1. | JS Basics Refresher, Loops, Naming Conventions | [Reading W1](/Week1/README.md) | [Assignment W1](/Week1/MAKEME.md) | -| 2. | Scope, ModernJS, Problem Solving | [Reading W2](/Week2/README.md) | [Assignment W2](/Week2/MAKEME.md) | -| 3. | Higher Order Functions, Closures, Unit Testing | [Reading W3](/Week3/README.md) | [Assignment W3](/Week3/MAKEME.md) | -| 4. | This keyword, constructor functions, classes | [Reading W4](/Week4/README.md) | [Assignment W4](/Week4/MAKEME.md) | - -## Finished? - -Did you finish the module? Good job! You're doing great! - -If you feel ready for the next challenge, click [here](https://www.github.com/HackYourFuture/Browsers) to go to Browsers! - -_The HackYourFuture curriculum is subject to CC BY copyright. This means you can freely use our materials, but just make sure to give us credit for it :)_ - -Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. diff --git a/Week1/MAKEME.md b/Week1/MAKEME.md deleted file mode 100644 index 9ffcc0c..0000000 --- a/Week1/MAKEME.md +++ /dev/null @@ -1,48 +0,0 @@ -# Assignment JavaScript Week 1 - -## **Todo list** - -1. JS Tutor -1. Practice the concepts -1. Prep exercises -1. Practice practice practice - -## **1. JS Tutor** - -Practice, practice, practice. This week you are not handing in any assignment, but are going to practice as much javascript as you can. Play around with the exercises mentioned below, remember that you can copy the code into [JS Tutor](http://pythontutor.com/javascript.html#mode=edit) to step through the code. Or look at it in the debugger in the browser/vscode. - -## **2. Practice the concepts** - -In this section you will be doing interactive exercises, that will allow you to practice with the concepts you've learned about this week! We provide a lot of possible exercises here and you probably can't do everything, but do as many as you need to feel comfortable with the concepts. Also feel free to come back to them later. - -- Do all parts of [Codecademy: Arrays](https://www.codecademy.com/courses/introduction-to-javascript/lessons/arrays) (Signup required!) -- Do 5 exercises of [FreeCodeCamp: Basic data structures](https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-data-structures) -- [Codecademy: Functions ](https://www.codecademy.com/courses/introduction-to-javascript/lessons/functions) -- [JSchallenger](https://www.jschallenger.com/) - Do all of the Javascript Basics section except for `scope` and `asynchronous javascript`. -- There is a practice-exercises folder in this week's repository that is filled with exercises to try out. The solutions are in a separate folder so you can check if you did it correctly. Clone this repository to your computer and have a go! - -## **3. Prep exercises** - -> Prep exercises are exercises that you should work on _before_ the session on Sunday. These are a little more difficult or show an important concept and as such are a great exercise to talk about with your cohort and your Q&A mentor. Have a solution ready by Sunday as you may be asked to show what you did. - -Inside your `JavaScript` fork, go to the folder `Week1`. Inside that folder, navigate to `/prep-exercises`. For each exercise, you will find a separate folder. The `README` explains what needs to be done. There will also be some questions at the bottom to think about. Go through them _before_ the session on Sunday as it will be covered then. - -## **4. Practice practice practice** - -Done with the above? Then it is time to practice practice practice! Below you will find huge lists of practice exercises to keep practicing. The better you get at JavaScript, the easier the rest of the curriculum is so try to do as much as you can. Some of these solutions use some of the concepts of next week so if something looks weird, have a quick look at next week's topics to see what it means: - -- [W3Resource Basic exercises](https://www.w3resource.com/javascript-exercises/javascript-basic-exercises.php) _(Note that the given solutions to these exercises use old JS syntax, we will learn more about this later. Most important now is that we don't use `var` anymore, so make sure you use `let` or `const`!)_ - -There are also multiple websites that provide constant challenges to practice your skills. These go from beginner to advanced and you should bookmark them and return every once in awhile. In some interview processes these kinds of exercises are given nowadays. We suggest to start with Edabit as they are more geared to beginners, the others start at a higher level: - -- [Edabit](https://edabit.com/challenges) - You can choose JavaScript as a language and then try solving as many challenges as you can. If you find the level too easy then you can choose a higher difficulty. -- [leetcode](https://leetcode.com/) - Sign up and start solving! -- [Code Wars](https://www.codewars.com/) - Once you feel comfortable with the JavaScript syntax sign up for code wars to practice. It is a website where you can solve exercises and rank up! When signing up, only choose JavaScript to really focus the problems on learning to solve problems in it. You can later change it to other technologies when you get more familiar. - -## No assignment to hand in (for now) - -For the first week of JavaScript there is no assignment to hand in as the exercises already give you all the feedback you need. - -## Done early? - -Try to do more exercises in the links above. The first weeks of the JavaScript modules are very important as understanding the basics will make the rest of the curriculum that much easier to follow. So keep reading and writing code! diff --git a/Week1/QA.md b/Week1/QA.md deleted file mode 100644 index 3498fcf..0000000 --- a/Week1/QA.md +++ /dev/null @@ -1,11 +0,0 @@ -# Q & A Session - -The first week of JavaScript we do not have an assignment and we encourage trainees to follow all the material at their own pace. So trainees can ask questions about any week. Expect questions about: - -- Functions -- Basic JavaScript blocks (let/const, operators, loops, if/else, functions) -- The Debugger (both browser/vscode) and how to debug -- Naming conventions -- DRY principle - -In these first weeks, we want to get the trainees to create the right mental model for JavaScript constructs, so try to go back to basics as much as possible. However easy it comes to the mentors, this is the first time trainees encounter all the syntax of a programming language. So try to go slowly and use the debugger / [JSTutor](http://pythontutor.com/javascript.html#mode=edit) as much as possible. diff --git a/Week1/README.md b/Week1/README.md deleted file mode 100644 index ae62329..0000000 --- a/Week1/README.md +++ /dev/null @@ -1,44 +0,0 @@ -# Reading Material JavaScript Week 1 - -## Agenda - -These are the topics for week 1: - -1. [Refresher on JavaScript building blocks](https://github.com/HackYourFuture/explore/tree/main/Week3) - - Variables - - Values - - Statements / Expressions - - Operators - - Conditional Statements - - [Functions](https://study.hackyourfuture.net/#/javascript/functions) -1. [Refresher on debuggers](https://study.hackyourfuture.net/#/tools/debuggers) -1. [Loops](https://study.hackyourfuture.net/#/javascript/loops) -1. [Naming conventions](https://study.hackyourfuture.net/#/programming/naming-conventions) -1. [Testing code](https://www.ministryoftesting.com/articles/e463d4ba?s_id=14519957) - - [Assertion](https://study.hackyourfuture.net/#/testing/assertion) - -## Week goals - -All of the detailed information about every concept is in your study book. The following goal explanation will link you to the correct place to get studying. Read through the goal description once to get an idea of what you will be learning, then go through the different links and look at them in detail. - -Welcome to week 1 of JavaScript! Time to get coding, let's start with refreshing the things we learned during the explore module. Have a look at [week 3](https://github.com/HackYourFuture/explore/tree/main/Week3) there again to remind yourself what the following concepts mean again: - -- Variables -- Values -- Statements / Expressions -- Operators -- Conditional Statements - -Then have a look at functions again over [here](https://study.hackyourfuture.net/#/javascript/functions). - -This week we are going to go a little deeper and get some extra building blocks to work with. Another cool thing we can do in JavaScript is repeat actions, we can do that using a concept called loops, read more about that [here](https://study.hackyourfuture.net/#/javascript/loops). - -You now have all of the basic building blocks that form the basis of all code! You will undoubtedly already have encountered the difficulty of reading code, and combining everything this week will make it even more difficult to follow. It is a good idea to revisit the debugger section with this new knowledge [here](https://study.hackyourfuture.net/#/tools/debuggers). Although it is called debugging, a lot of the process of finding 'bugs' in your code is trying to understand what is happening in the code. So keep using the debugger to understand pieces of code that you are not 100% comfortable with yet! - -This is also the week we are going to start learning about best practices surrounding programming. These are general rules programmers follow so that code remains readable for others. The first will be about naming conventions, read more about that [here](https://study.hackyourfuture.net/#/programming/naming-conventions) and try to make it a habit to follow them. - -Lastly we want to introduce the first steps to testing code. Let's first have a look at what software testing is and why we do it [here](https://www.ministryoftesting.com/articles/e463d4ba?s_id=14519957). The simplest form of testing is using assertions, have a look what that is [here](https://study.hackyourfuture.net/#/testing/assertion), we will introduce this more in your assignment so you will see how it works. - -## Finished? - -Are you finished with going through the materials? You're doing great! If you feel ready to get practical, click [here](./MAKEME.md). diff --git a/Week1/practice-exercises/1-remove-the-comma.js b/Week1/practice-exercises/1-remove-the-comma.js deleted file mode 100644 index b71cffd..0000000 --- a/Week1/practice-exercises/1-remove-the-comma.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * We want to remove the comma's in the given string (myString), replace them with a space and log it to the console. - * - * The end result should be: - * hello this is a difficult to read sentence - */ - -let myString = 'hello,this,is,a,difficult,to,read,sentence'; - - - -/* --- Code that will test your solution, do NOT change. Write above this line --- */ - -console.assert(myString === 'hello this is a difficult to read sentence', 'There is something wrong with your solution'); \ No newline at end of file diff --git a/Week1/practice-exercises/2-even-odd-reporter.js b/Week1/practice-exercises/2-even-odd-reporter.js deleted file mode 100644 index 6edf23e..0000000 --- a/Week1/practice-exercises/2-even-odd-reporter.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Report whether or not a number is odd/even! - * - * Create a for loop, that iterates from 0 to 20. - * Create a conditional statement that checks if the value of the counter variable is odd or even. - * If it's odd, log to the console The number [PUT_NUMBER_HERE] is odd!. - * If it's even, log to the console The number [PUT_NUMBER_HERE] is even!. - */ - diff --git a/Week1/practice-exercises/3-recipe-card.js b/Week1/practice-exercises/3-recipe-card.js deleted file mode 100644 index 24bcb54..0000000 --- a/Week1/practice-exercises/3-recipe-card.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * Ever wondered how to make a certain meal? Let's create a recipe list with JavaScript! - * - * Declare a variable that holds an empty object literal (your meal recipe). - * Give the object 3 properties: a title (string), a servings (number) and an ingredients (array of strings) property. - * Log each property out separately, using a loop (for, while or do/while) - * - * Expected result: - * - * Meal name: Omelette - * Serves: 2 - * Ingredients: 4 eggs, 2 strips of bacon, 1 tsp salt/pepper - */ - diff --git a/Week1/practice-exercises/4-reading-list.js b/Week1/practice-exercises/4-reading-list.js deleted file mode 100644 index f535657..0000000 --- a/Week1/practice-exercises/4-reading-list.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * Keep track of which books you read and which books you want to read! - * - * Follow the steps: - * Declare a variable that holds an array of 3 objects, where each object describes a book and has properties for the title (string), author (string), and alreadyRead (boolean indicating if you read it yet). - * Loop through the array of books. - * For each book, log the book title and book author like so: "The Hobbit by J.R.R. Tolkien". - * Create a conditional statement to change the log depending on whether you read it yet or not. If you read it, log a string like You already read "The Hobbit" right after the log of the book details - * If you haven't read it log a string like You still need to read "The Lord of the Rings" - */ - diff --git a/Week1/practice-exercises/5-who-wants-a-drink.js b/Week1/practice-exercises/5-who-wants-a-drink.js deleted file mode 100644 index f37f02b..0000000 --- a/Week1/practice-exercises/5-who-wants-a-drink.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * You're at a party and you feel thirsty! However, you've got 5 friends who are also in need of a drink. Let's go get them a drink. - * - * Declare a variable that holds an empty array, called drinkTray. - * Create a loop that runs 5 times. On each iteration, push a drink into the drinkTray variable. The drinkTray can only hold at most two instances of the same drink type, for example it can only hold 2 colas, 2 lemonades, 2 waters. - * - * Log to the console: "Hey guys, I brought a [INSERT VALUES FROM ARRAY]!" (For example: "Hey guys, I brought a cola, cola, lemonade, lemonade, water!") - */ - -// There are 3 different types of drinks: -const drinkTypes = ['cola', 'lemonade', 'water']; \ No newline at end of file diff --git a/Week1/practice-exercises/solutions/1-remove-the-comma.js b/Week1/practice-exercises/solutions/1-remove-the-comma.js deleted file mode 100644 index 0839202..0000000 --- a/Week1/practice-exercises/solutions/1-remove-the-comma.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * We want to remove the comma's in the given string (myString), replace them with a space and log it to the console. - * - * The end result should be: - * hello this is a difficult to read sentence - */ - -let myString = 'hello,this,is,a,difficult,to,read,sentence'; - -myString = myString.split(',').join(' '); - -/* --- Code that will test your solution, do NOT change. Write above this line --- */ - -console.assert(myString === 'hello this is a difficult to read sentence', 'There is something wrong with your solution'); \ No newline at end of file diff --git a/Week1/practice-exercises/solutions/2-even-odd-reporter.js b/Week1/practice-exercises/solutions/2-even-odd-reporter.js deleted file mode 100644 index 520d16a..0000000 --- a/Week1/practice-exercises/solutions/2-even-odd-reporter.js +++ /dev/null @@ -1,16 +0,0 @@ -/** - * Report whether or not a number is odd/even! - * - * Create a for loop, that iterates from 0 to 20. - * Create a conditional statement that checks if the value of the counter variable is odd or even. - * If it's odd, log to the console The number [PUT_NUMBER_HERE] is odd!. - * If it's even, log to the console The number [PUT_NUMBER_HERE] is even!. - */ - -for (let i = 0; i < 21; i++) { - if (i % 2 == 0) { - console.log(`The number ${i} is even!`); - } else { - console.log(`The number ${i} is odd!`); - } -} \ No newline at end of file diff --git a/Week1/practice-exercises/solutions/3-recipe-card.js b/Week1/practice-exercises/solutions/3-recipe-card.js deleted file mode 100644 index 4ae2b7a..0000000 --- a/Week1/practice-exercises/solutions/3-recipe-card.js +++ /dev/null @@ -1,17 +0,0 @@ -const myRecipe = { - title: 'Omelette', - servings: 2, - ingredients: ['4 eggs', '2 strips of bacon', '1 tsp salt/pepper'], -}; - -for (let item in myRecipe) { - if (item == 'title') { - console.log(`Meal name: ${myRecipe[item]}`); - } else if (item == 'servings') { - console.log(`Serves: ${myRecipe[item]}`); - } else { - const ingredientList = myRecipe[item]; - - console.log(`Ingedients: ${ingredientList.join(', ')}`); - } -} \ No newline at end of file diff --git a/Week1/practice-exercises/solutions/4-reading-list.js b/Week1/practice-exercises/solutions/4-reading-list.js deleted file mode 100644 index 6d70fb3..0000000 --- a/Week1/practice-exercises/solutions/4-reading-list.js +++ /dev/null @@ -1,27 +0,0 @@ -const listOfBooks = [ - { - title: 'Hard Times', - author: 'Charles Dickens', - alreadyRead: true - }, - { - title: 'The Grapes of Wrath', - author: 'John Steinbeck', - alreadyRead: true - }, - { - title: 'The Fellowship of the Ring', - author: 'Peter Jackson', - alreadyRead: false - } -]; - -for (let bookIndex in listOfBooks) { - const book = listOfBooks[bookIndex]; - - if (book.alreadyRead) { - console.log(`${book.title} by ${book.author}. You already read "${book.title}".`); - } else { - console.log(`${book.title} by ${book.author}. You still need to read "${book.title}".`); - } -} \ No newline at end of file diff --git a/Week1/practice-exercises/solutions/5-who-wants-a-drink.js b/Week1/practice-exercises/solutions/5-who-wants-a-drink.js deleted file mode 100644 index 5db1ea2..0000000 --- a/Week1/practice-exercises/solutions/5-who-wants-a-drink.js +++ /dev/null @@ -1,24 +0,0 @@ -/** - * You're at a party and you feel thirsty! However, you've got 5 friends who are also in need of a drink. Let's go get them a drink. - * - * Declare a variable that holds an empty array, called drinkTray. - * Create a loop that runs 5 times. On each iteration, push a drink into the drinkTray variable. The drinkTray can only hold at most two instances of the same drink type, for example it can only hold 2 colas, 2 lemonades, 2 waters. - * - * Log to the console: "Hey guys, I brought a [INSERT VALUES FROM ARRAY]!" (For example: "Hey guys, I brought a cola, cola, lemonade, lemonade, water!") - */ - -// There are 3 different types of drinks: -const drinkTypes = ['cola', 'lemonade', 'water']; -const drinkTray = []; - -// This is one way of doing it, there are many more. It hopefully showcases a nice use case of the double for loop -// It could also have been written with a while loop that would be a little more efficient -for (let i = 0; i < drinkTypes.length; i++) { - for (let j = 0; j < 2; j++) { - if (drinkTray.length < 5) { - drinkTray.push(drinkTypes[i]); - } - } -} - -console.log(`Hey guys, I brought a ${drinkTray.join(', ')}!`); \ No newline at end of file diff --git a/Week1/prep-exercises/1-traffic-light/README.md b/Week1/prep-exercises/1-traffic-light/README.md deleted file mode 100644 index d994741..0000000 --- a/Week1/prep-exercises/1-traffic-light/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Prep exercise - traffic light - -Let's have a deeper look at the working of traffic lights this week so that we can practice logic and loops. In `traffic-light-1.js` and `traffic-light-2.js` you will find the same requirements but with different ways of representing the traffic light. Have a look through the files and solve them so you can see how the way we represent data affects the way we need to solve problems. - -## Things to think about - -- Which way of representing the traffic light did you find better? Why? -- What happens if you change the loop to a `do-while` loop instead of a `while` loop? Why? -- We could have also used a `for` loop to make the traffic light do 2 full rotations. Do you think that would be better? Why or why not? diff --git a/Week1/prep-exercises/1-traffic-light/traffic-light-1.js b/Week1/prep-exercises/1-traffic-light/traffic-light-1.js deleted file mode 100644 index f1d9169..0000000 --- a/Week1/prep-exercises/1-traffic-light/traffic-light-1.js +++ /dev/null @@ -1,31 +0,0 @@ -"use strict"; -/** - * The `state` property says what the traffic light's state (i.e. colour) is at - * that moment. - */ -const trafficLight = { - state: "green", -}; - -let rotations = 0; -while (rotations < 2) { - const currentState = trafficLight.state; - console.log("The traffic light is on", currentState); - - // TODO - // if the color is green, turn it orange - // if the color is orange, turn it red - // if the color is red, add 1 to rotations and turn it green -} - -/** - * The output should be: - -The traffic light is on green -The traffic light is on orange -The traffic light is on red -The traffic light is on green -The traffic light is on orange -The traffic light is on red - -*/ diff --git a/Week1/prep-exercises/1-traffic-light/traffic-light-2.js b/Week1/prep-exercises/1-traffic-light/traffic-light-2.js deleted file mode 100644 index 8c6ba95..0000000 --- a/Week1/prep-exercises/1-traffic-light/traffic-light-2.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -/** - * The `possibleStates` property define the states (in this case: colours) - * in which the traffic light can be. - * The `stateIndex` property indicates which of the possible states is current. - */ -const trafficLight = { - possibleStates: ["green", "orange", "red"], - stateIndex: 0, -}; - -let cycle = 0; -while (cycle < 2) { - const currentState = trafficLight.possibleStates[trafficLight.stateIndex]; - console.log("The traffic light is on", currentState); - - // TODO - // if the color is green, turn it orange - // if the color is orange, turn it red - // if the color is red, add 1 to cycles and turn it green -} - -/** - * The output should be: - -The traffic light is on green -The traffic light is on orange -The traffic light is on red -The traffic light is on green -The traffic light is on orange -The traffic light is on red - -*/ diff --git a/Week2/MAKEME.md b/Week2/MAKEME.md deleted file mode 100644 index ca85c57..0000000 --- a/Week2/MAKEME.md +++ /dev/null @@ -1,36 +0,0 @@ -# Assignment JavaScript Week 2 - -This will be the first week you are expected to hand in an assignment when we combine all of the concepts you have been practicing the last 3 weeks. - -## **Todo list** - -1. Prep exercises -1. Assignment -1. Practice practice practice - -## **1. Prep exercises** - -> Prep exercises are exercises that you should work on _before_ the session on Sunday. These are a little more difficult or show an important concept and as such are a great exercise to talk about with your cohort and your Q&A mentor. Have a solution ready by Sunday as you may be asked to show what you did. - -Inside your `JavaScript` fork, go to the folder `Week2`. Inside of that folder, navigate to `/prep-exercises`. For each exercise, you will find a separate folder. The `README` explains what needs to be done. There will also be some questions at the bottom to think about. Go through them _before_ the session on Sunday as it will be covered then. - -## **2. Assignment** - -It is time to combine everything we have learned the past couple of weeks and get some feedback from experienced developers. This will be the first week you are working with the assignment repository so reserve some time to set it up. You will find the repository in our [HackYourAssignment](https://github.com/HackYourAssignment/) GitHub page. There should be one called Assignment-cohortXX where XX is your cohort number, you will want to fork that to your own GitHub. Have a look at the [Assignment guide](../hand-in-assignments-guide.md) to see how to hand in your assignment. - -This week we expect you to do the exercises in the corresponding module/week folder (JavaScript / Week 2). - -_NOTE: Make sure to read and apply all of the steps in the README in the assignment repository to set up the extensions in Visual Studio Code!_. - -## **3. Practice practice practice** - -Done with the above? Then it is time to practice practice practice! Below you will find huge lists of practice exercises to keep practicing. The better you get at JavaScript, the easier the rest of the curriculum is so try to do as much as you can. Some of these solutions use some of the concepts of next week so if something looks weird, have a quick look at next week's topics to see what it means: - -- [JSchallenger](https://www.jschallenger.com/) - Do the `scope` part in the `Basics` section. Then do the following in the Javascript Practice section (fundamentals, arrays, objects). -- [W3Resource - JavaScript Fundamental exercises](https://www.w3resource.com/javascript-exercises/fundamental/index.php) - -Also keep going with all of the from beginner to advanced platforms mentioned last week! - -## Done early? - -Try to do more exercises in the links above. The first weeks of the JavaScript modules are very important as understanding the basics will make the rest of the curriculum that much easier to follow. So keep reading and writing code! diff --git a/Week2/QA.md b/Week2/QA.md deleted file mode 100644 index 55aea31..0000000 --- a/Week2/QA.md +++ /dev/null @@ -1,10 +0,0 @@ -# Q & A session - -This week we are going deeper into more advanced topics, so expect questions about: - -- Scope -- The Debugger (both browser/vscode) and how to debug functions -- DRY principle -- Naming conventions - -In these first weeks we want to get the trainees to create the right mental model for JavaScript constructs, so try to go back to basics as much as possible. However easy it comes to the mentors, this is the first time trainees encounter all the syntax of a programming language. So try to go slowly and use the debugger / [JSTutor](http://pythontutor.com/javascript.html#mode=edit) as much as possible. diff --git a/Week2/README.md b/Week2/README.md deleted file mode 100644 index 3feb55c..0000000 --- a/Week2/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Reading Material JavaScript Week 2 - -## Agenda - -These are the topics for week 2: - -1. [Scope](https://study.hackyourfuture.net/#/javascript/scope) -1. [Modern JS](https://study.hackyourfuture.net/#/javascript/modern-js) -1. [Problem solving](https://study.hackyourfuture.net/#/programming/problem-solving-process) - -## Week goals - -Functions bring along with them a concept called the scope that you may have encountered a bit already but we want to explicitly explain now. Read about scope [here](https://study.hackyourfuture.net/#/javascript/scope). - -We have to confess we also kept something else from you until now, JavaScript has different versions. JavaScript has been evolving over its lifetime and certain syntax has been added. Have a look in your study book at the topic of what is called 'Modern JS' [here](https://study.hackyourfuture.net/#/javascript/modern-js). Throughout the curriculum we will be expecting you to use the modern syntax as that is most likely what you will be programming in. You can skip the sections that are about Promises and async/await for now, we will get there in the Using API's module. There is also a section on the history of JavaScript in there, you do not need to know this but we recommend it if you have some time to spare as it is very interesting. - -Now that we are getting into more and more complex code it is also a good idea to learn a structured way to solve more complex problems. Have a look at the page on problem solving in your study book over [here](https://study.hackyourfuture.net/#/programming/problem-solving-process). - -## Finished? - -Are you finished with going through the materials? Give yourself a pat on the back because you rock! It is time to combine everything you have learned and start practicing them vigorously. Have a look at the exercises [here](./MAKEME.md) and try to make as many of them as you can. This week there will be an assignment to do and hand in, so don't forget to do that! If you haven't set up the assignment repository yet, have a look at your class repo. diff --git a/Week2/prep-exercises/1-traffic-light/README.md b/Week2/prep-exercises/1-traffic-light/README.md deleted file mode 100644 index b3c3748..0000000 --- a/Week2/prep-exercises/1-traffic-light/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Prep exercise - Traffic light - -In the previous week we started with our traffic light. Now that we also know what a function is we have one last look at the workings of a traffic light in a different way. Take a look at the `traffic-light.js` file and implement the same requirements as last week again, but then with another different way of organising. - -## Things to think about - -- This time the loop was changed to a for loop that will run the code 6 times. Why was that needed? -- Why was the trafficLight added to the `main` function and not left at the top of the file? -- What do you think is the advantage of having the `getCurrentTrafficLightState` and `getNextStateIndex` functions? diff --git a/Week2/prep-exercises/1-traffic-light/traffic-light.js b/Week2/prep-exercises/1-traffic-light/traffic-light.js deleted file mode 100644 index f4a5c1a..0000000 --- a/Week2/prep-exercises/1-traffic-light/traffic-light.js +++ /dev/null @@ -1,60 +0,0 @@ -"use strict"; -/** - * The `trafficLight` object is now no longer a global variable. Instead, - * it is defined in function `main()` and passed as a parameter to other - * functions, as and when needed. - */ - -function getCurrentState(trafficLight) { - // TODO - // Should return the current state (i.e. colour) of the `trafficLight` - // object passed as a parameter. -} - -function getNextStateIndex(trafficLight) { - // TODO - // Return the index of the next state of the `trafficLight` such that: - // - if the color is green, it will turn to orange - // - if the color is orange, it will turn to red - // - if the color is red, it will turn to green -} - -// This function loops for the number of seconds specified by the `secs` -// parameter and then returns. -// IMPORTANT: This is not the recommended way to implement 'waiting' in -// JavaScript. You will learn better ways of doing this when you learn about -// asynchronous code. -function waitSync(secs) { - const start = Date.now(); - while (Date.now() - start < secs * 1000) { - // nothing do to here - } -} - -function main() { - const trafficLight = { - possibleStates: ["green", "orange", "red"], - stateIndex: 0, - }; - - for (let cycle = 0; cycle < 6; cycle++) { - const currentState = getCurrentState(trafficLight); - console.log(cycle, "The traffic light is now", currentState); - - waitSync(1); // Wait a second before going to the next state - trafficLight.stateIndex = getNextStateIndex(trafficLight); - } -} - -main(); -/** - * The output should be: - -0 The traffic light is now green -1 The traffic light is now orange -2 The traffic light is now red -3 The traffic light is now green -4 The traffic light is now orange -5 The traffic light is now red - -*/ diff --git a/Week2/prep-exercises/2-experiments/README.md b/Week2/prep-exercises/2-experiments/README.md deleted file mode 100644 index a0e63ca..0000000 --- a/Week2/prep-exercises/2-experiments/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# Prep exercises - Dice experimentation - -Let's do some experiments! One thing computers are great at is doing the same thing over and over and over again, so let's use that to see how random the random function in JavaScript is. In the `index.js` there is an explanation of what to implement. In essence we want to simulate the rolling of a die a lot of times and then track how many times a certain value was rolled. - -For a fair die the chance of rolling a certain value should be equal for all possible values. When rolling a six-sided die many times we therefore expect the number of times each value is thrown to approach 16.6% (1/6) of the total number of rolls. The more rolls we do the closer we should get to the expected value, following the [Law of large numbers](https://en.wikipedia.org/wiki/Law_of_large_numbers). - -> Wikipedia: _In probability theory, the law of large numbers (LLN) is a theorem that describes the result of performing the same experiment a large number of times. According to the law, the average of the results obtained from a large number of trials should be close to the expected value and tends to become closer to the expected value as more trials are performed._ - -In this prep exercise we are using the `Math.random()` function to simulate throwing a die. So what we are actually testing here is how well `Math.random()` distributes its values evenly across the range of 0 to 1 when called many times. We will do this for an increasing number of rolls (`sampleSize` in the code) and expect the results to even out to 16.6% across all values. - -## Things to think about - -- The `valueCounts` is implemented as an array. Do you think there is another way to store this? Why do you think the decision was made to go with an array? -- What do you think about the code division? Would you add another function or maybe remove one? Why? diff --git a/Week2/prep-exercises/2-experiments/index.js b/Week2/prep-exercises/2-experiments/index.js deleted file mode 100644 index 7e5aa92..0000000 --- a/Week2/prep-exercises/2-experiments/index.js +++ /dev/null @@ -1,46 +0,0 @@ -"use strict"; - -function runExperiment(sampleSize) { - const valueCounts = [0, 0, 0, 0, 0, 0]; - - // TODO - // Write a for loop that iterates `sampleSize` times (sampleSize is a number). - // In each loop iteration: - // - // 1. Generate a random integer between 1 and 6 (as if throwing a six-sided die). - // 2. Add `1` to the element of the `valueCount` that corresponds to the random - // value from the previous step. Use the first element of `valueCounts` - // for keeping a count how many times the value 1 is thrown, the second - // element for value 2, etc. - - const results = []; - - // TODO - // Write a for..of loop for the `valueCounts` array created in the previous - // loop. In each loop iteration: - // 1. For each possible value of the die (1-6), compute the percentage of how - // many times that value was thrown. Remember that the first value of - // `valueCounts` represent the die value of 1, etc. - // 2. Convert the computed percentage to a number string with a precision of - // two decimals, e.g. '14.60'. - // 3. Then push that string onto the `results` array. - - return results; -} - -function main() { - const sampleSizes = [100, 1000, 1000000]; - - // TODO - // Write a for..of loop that calls the `runExperiment()` function for each - // value of the `sampleSizes` array. - // Log the results of each experiment as well as the experiment size to the - // console. - // The expected output could look like this: - // - // [ '26.00', '17.00', '10.00', '19.00', '16.00', '12.00' ] 100 - // [ '14.60', '17.10', '19.30', '15.50', '16.70', '16.80' ] 1000 - // [ '16.71', '16.68', '16.69', '16.66', '16.67', '16.59' ] 1000000 -} - -main(); diff --git a/Week3/MAKEME.md b/Week3/MAKEME.md deleted file mode 100644 index 0073857..0000000 --- a/Week3/MAKEME.md +++ /dev/null @@ -1,37 +0,0 @@ -# Assignment JavaScript Week 3 - -## **Todo list** - -1. Practice the concepts -1. Prep exercises -1. Assignment -1. Extra: Challenges (Optional) - -## **1. Practice the concepts** - -Before we head into the assignment, it might be nice to do some interactive exercises first! In the following resource you'll find some exercises that'll teach you all about higher order and array functions! - -- [Learn JavaScript: Higher Order Functions](https://www.codecademy.com/courses/introduction-to-javascript/lessons/higher-order-functions/exercises/introduction) -- [Learn JavaScript: Iterators](https://www.codecademy.com/courses/introduction-to-javascript/lessons/javascript-iterators/exercises/intro) - -## **2. Prep exercises** - -> Prep exercises are exercises that you should work on _before_ the session on Sunday. These are a little more difficult or show an important concept and as such are a great exercise to talk about with your cohort and your Q&A mentor. Have a solution ready by Sunday as you may be asked to show what you did. - -Inside your `JavaScript` fork, go to the folder `Week3`. Inside of that folder, navigate to `/prep-exercises`. For each exercise, you will find a separate folder. The `README` explains what needs to be done. There will also be some questions at the bottom to think about. Go through them _before_ the session on Sunday as it will be covered then. - -## **3. Assignment** - -This week we expect you to do the exercises in the corresponding module/week folder (JavaScript / Week 3). Have a look at the [assignment guide](https://github.com/HackYourFuture/JavaScript/blob/main/hand-in-assignments-guide.md) to see how to hand in your assignment. - -_NOTE: do NOT forget to checkout the main branch before creating the branch for this week. Otherwise your previous assignment will be a part of the PR_ - -## **4. Extra: Challenges (Optional)** - -Have a look at the challenges folder in this repository to try some harder problems. We expect these to be hard, so take your time to try and solve them yourself. If you really can't figure it out then have a look at the solutions, but it usually sticks better if you find the solution yourself. - -Also keep going with all of the from beginner to advanced platforms mentioned last week! - -## Finished? - -Try to do more exercises in the links above. The first weeks of the JavaScript modules are very important as understanding the basics will make the rest of the curriculum that much easier to follow. So keep reading and writing code! diff --git a/Week3/QA.md b/Week3/QA.md deleted file mode 100644 index 5f52c87..0000000 --- a/Week3/QA.md +++ /dev/null @@ -1,9 +0,0 @@ -# Q & A session - -The third week is all about more complex JavaScript topics. By now the trainees should have the basics down, so expect some tougher questions. Expect questions about: - -- Higher Order Functions -- _Closures_ -- The Debugger (both browser/vscode) and how to debug functions - -We have noticed that Closures are tough for the trainees, so try to spend any time you have spare on that topic. Also try to keep using the debugger to show what happens line by line! diff --git a/Week3/README.md b/Week3/README.md deleted file mode 100644 index 0076edc..0000000 --- a/Week3/README.md +++ /dev/null @@ -1,27 +0,0 @@ -# Reading Material JavaScript Week 3 - -## Agenda - -These are the topics for week 3: - -1. [Higher Order Functions](https://study.hackyourfuture.net/#/javascript/higher-order-functions) - - Array methods -1. [Closures](https://study.hackyourfuture.net/#/javascript/closures) - - Execution context - - Why do we need closures? -1. [Unit testing](https://study.hackyourfuture.net/#/testing/unit-tests) - - [Testing framework (Jest)](https://study.hackyourfuture.net/#/tools/test-framework) - -## Week goals - -This week we are going to keep practicing coding and introducing a few more advanced topics that you will encounter. Firstly, higher order functions are a way functions are being used regularly in the real world, most notably in the methods `Array`'s provide us. Read all about it [here](https://study.hackyourfuture.net/#/javascript/higher-order-functions). Our graduates recommend to spend extra time learning the `Array` methods as they are a huge part of solving problems. - -Secondly, JavaScript has a thing called closures which you should know about. You will most likely not encounter issues with them any time soon, but it is good to have in the back of your mind that this exists. So read all about them [here](https://study.hackyourfuture.net/#/javascript/closures). - -Previously, we learned about the `assert` function which allow us to make code checks, but that is only the start. For consistent testing we developers write something we call unit tests, have a look at what that means [here](https://study.hackyourfuture.net/#/testing/unit-tests). Then have a look at test frameworks and what they can do over [here](https://study.hackyourfuture.net/#/tools/test-framework). Note that in our curriculum we will always be using _Jest_ as it is very popular and works well with React which we will be studying later. Behind the scenes we have been testing your homework with Jest all this time and it is where the error messages when running your homework comes from! - -After that it is time to start practicing again, make as many exercises as you can in the list [here](./MAKEME.md) and don't forget to hand in your assignment. There will also be a test coming up for this module. What and when will be announced in your class channel, so keep an eye on that as usual! The best way to prepare is to keep programming! - -## Finished? - -Are you finished with going through the materials? Give yourself a pat on the back because you rock! When you feel ready to get practical, click [here](./MAKEME.md). diff --git a/Week3/challenges/1-sum-entries.js b/Week3/challenges/1-sum-entries.js deleted file mode 100644 index f7dd419..0000000 --- a/Week3/challenges/1-sum-entries.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Credit to https://adventofcode.com/ for this exercise - -In the list below you have an array of numbers. The goal is to find the two numbers that add up to 2020. - -Once you have found those numbers, multiply the numbers and store the result of that in the result variable. - */ - - -const list = [1721, 979, 366, 299, 675, 1456]; -let result; - -// Write your code here - - -// TEST CODE, do not change -console.assert(result === 514579, `The result is not correct, it is ${result}, but should be 514579`); \ No newline at end of file diff --git a/Week3/challenges/2-sum-three-entries.js b/Week3/challenges/2-sum-three-entries.js deleted file mode 100644 index f5f8773..0000000 --- a/Week3/challenges/2-sum-three-entries.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * Credit to https://adventofcode.com/ for this exercise - -In the list below you have an array of numbers. The goal is to find the three numbers that add up to 2020. - -Once you have found those numbers, multiply the numbers and store the result of that in the result variable. - */ - - -const list = [1721, 979, 366, 299, 675, 1456]; -let result; - -// Write your code here - - -// TEST CODE, do not change -console.assert(result === 241861950, `The result is not correct, it is ${result}, but should be 241861950`); \ No newline at end of file diff --git a/Week3/challenges/3-password-validation.js b/Week3/challenges/3-password-validation.js deleted file mode 100644 index fa7ad11..0000000 --- a/Week3/challenges/3-password-validation.js +++ /dev/null @@ -1,23 +0,0 @@ - -/** - * Credit to https://adventofcode.com/ for this exercise - * - * Each object in the passwordList gives a password policy and then the password. - * The times field says the minimal and maximal amount of times the letter should be in the password. So 1-3 means at least 1 time, at most 3 times. - * The letter field gives which letter should be counted - * The password field gives the password - * - * In the list 2 passwords are valid, the middle one is not as there is no b in the password. - * - * We expect the output: - * - * 'abcde' is VALID, a is present 1 times and should have been present at least 1 and at most 3 times - * 'cdefg' is INVALID, b is present 0 times and should have been present at least 1 and at most 3 times - * 'ccccccccc' is VALID, c is present 9 times and should have been present at least 2 and at most 9 times - */ - -const passwordList = [ - { times: '1-3', letter: 'a', password: 'abcde'}, - { times: '1-3', letter: 'b', password: 'cdefg'}, - { times: '2-9', letter: 'c', password: 'ccccccccc'} -]; \ No newline at end of file diff --git a/Week3/challenges/4-bank-account.js b/Week3/challenges/4-bank-account.js deleted file mode 100644 index 8f0f035..0000000 --- a/Week3/challenges/4-bank-account.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * It is time to write some bigger code! You have a bankAccount that is modeled as given. - * - * Finish the two functions that will donate money (donateMoney) and pay rent (payRent). - * If you do not have enough funds, call the onFail function given and don't change the bankAccount. - * If you do have the funds, update the bankAccount accordingly. - * - * TIP: have a look at the test code to get more information on what needs to happen - * TIP: a lot of the things the functions do are the same, you may want to create one or more other functions to not duplicate code - */ - -const bankAccount = { - // The currentBalance is how much money you have in your bankAccount. - currentBalance: 250, - // The transactions are a list of changes so that you can keep track. - transactions: [ - /** - * The prevAmount is what your balance was before the transaction, - * the newAmount is what your balance was after the transaction - * and the reason is what the transaction was about - */ - { - prevAmount: 350, - newAmount: 250, - reason: "Donation", - }, - ], -}; - -const donateMoney = (amount, onSuccess, onFail) => { - // TODO complete this function -}; -const payRent = (amount, onSuccess, onFail) => { - // TODO complete this function -}; - -/** - * TEST CODE. DO NOT EDIT - */ - -const onSuccessEnglish = () => { - console.log("Payment successful! Thank you!"); -}; -const onFailEnglish = () => { - console.log("You do not have enough money to make this payment."); -}; - -const onSuccessDutch = () => { - console.log("Betaling geslaagd! Dank u!"); -}; -const onFailDutch = () => { - console.log("U heeft niet voldoende saldo om deze betaling te doen."); -}; - -donateMoney(100, onSuccessEnglish, onFailEnglish); -console.log(bankAccount); - -payRent(100, onSuccessEnglish, onFailEnglish); -console.log(bankAccount); - -donateMoney(100, onSuccessDutch, onFailDutch); -console.log(bankAccount); - -/** -* The console should print out the following: -Payment successful! Thank you! -{ -currentBalance: 150, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' } -] -} -Payment successful! Thank you! -{ -currentBalance: 50, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' }, - { prevAmount: 150, newAmount: 50, reason: 'Rent' } -] -} -U heeft niet voldoende saldo om deze betaling te doen. -{ -currentBalance: 50, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' }, - { prevAmount: 150, newAmount: 50, reason: 'Rent' } -] -} -* -*/ diff --git a/Week3/challenges/solutions/1-sum-entries.js b/Week3/challenges/solutions/1-sum-entries.js deleted file mode 100644 index 875c7ec..0000000 --- a/Week3/challenges/solutions/1-sum-entries.js +++ /dev/null @@ -1,14 +0,0 @@ -const list = [1721, 979, 366, 299, 675, 1456]; -let result; - -list.forEach((item, idx) => { - // We use a for loop here instead of forEach so we only compare the numbers after the current item in the list - for (let i = idx + 1; i < list.length; i++) { - if ((item + list[i]) === 2020) { - result = item * list[i]; - } - } -}); - -// TEST CODE, do not change -console.assert(result === 514579, `The result is not correct, it is ${result}, but should be 514579`); \ No newline at end of file diff --git a/Week3/challenges/solutions/2-sum-three-entries.js b/Week3/challenges/solutions/2-sum-three-entries.js deleted file mode 100644 index 479769d..0000000 --- a/Week3/challenges/solutions/2-sum-three-entries.js +++ /dev/null @@ -1,16 +0,0 @@ -const list = [1721, 979, 366, 299, 675, 1456]; -let result; - -list.forEach((item, idx) => { - // We use a for loop here instead of forEach so we only compare the numbers after the current item in the list - for (let i = idx + 1; i < list.length; i++) { - for (let j = i + 1; j < list.length; j++) { - if ((item + list[i] + list[j]) === 2020) { - result = item * list[i] * list[j]; - } - } - } -}); - -// TEST CODE, do not change -console.assert(result === 241861950, `The result is not correct, it is ${result}, but should be 241861950`); \ No newline at end of file diff --git a/Week3/challenges/solutions/3-password-validation.js b/Week3/challenges/solutions/3-password-validation.js deleted file mode 100644 index 4f6985a..0000000 --- a/Week3/challenges/solutions/3-password-validation.js +++ /dev/null @@ -1,22 +0,0 @@ -const passwordList = [ - { times: '1-3', letter: 'a', password: 'abcde'}, - { times: '1-3', letter: 'b', password: 'cdefg'}, - { times: '2-9', letter: 'c', password: 'ccccccccc'} -]; - -passwordList.forEach(item => { - // convert the element password to array - const { password, times, letter } = item; - - const onlyLetterArray = Array.from(password).filter(character => character === letter); - const amountOfInstancesOfLetter = onlyLetterArray.length; - const minimumAmount = parseInt(times.slice(0, 1)); - const maximumAmount = parseInt(times.slice(2)); - - if (amountOfInstancesOfLetter >= minimumAmount && amountOfInstancesOfLetter <= maximumAmount) { - console.log(`${password} is VALID, ${letter} is present ${amountOfInstancesOfLetter} times and should have been present at least ${minimumAmount} and at most ${maximumAmount} times`); - } - else { - console.log(`${password} is INVALID, ${letter} is present ${amountOfInstancesOfLetter} times and should have been present at least ${minimumAmount} and at most ${maximumAmount} times`); - } -}); \ No newline at end of file diff --git a/Week3/challenges/solutions/4-bank-account.js b/Week3/challenges/solutions/4-bank-account.js deleted file mode 100644 index e4eca97..0000000 --- a/Week3/challenges/solutions/4-bank-account.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * It is time to write some bigger code! You have a bankAccount that is modeled as given. - * - * Finish the two functions that will donate money (donateMoney) and pay rent (payRent). - * If you do not have enough funds, call the onFail function given and don't change the bankAccount. - * If you do have the funds, update the bankAccount accordingly. - * - * TIP: have a look at the test code to get more information on what needs to happen - * TIP: a lot of the things the functions do are the same, you may want to create one or more other functions to not duplicate code - */ - -const bankAccount = { - // The currentBalance is how much money you have in your bankAccount. - currentBalance: 250, - // The transactions are a list of changes so that you can keep track. - transactions: [ - /** - * The prevAmount is what your balance was before the transaction, - * the newAmount is what your balance was after the transaction - * and the reason is what the transaction was about - */ - { - prevAmount: 350, - newAmount: 250, - reason: "Donation", - }, - ], -}; - -/** - * The donateMoney and payRent do a lot of the same thing, so created a separate function - */ -const createPayment = (amount, onSuccess, onFail, reason) => { - const newAmount = bankAccount.currentBalance - amount; - - if (newAmount < 0) { - onFail(); - - return; - } - - bankAccount.transactions.push({ - prevAmount: bankAccount.currentBalance, - newAmount, - reason, - }); - bankAccount.currentBalance = newAmount; - - onSuccess(); -}; -const donateMoney = (amount, onSuccess, onFail) => { - createPayment(amount, onSuccess, onFail, "Donation"); -}; -const payRent = (amount, onSuccess, onFail) => { - createPayment(amount, onSuccess, onFail, "Rent"); -}; - -/** - * TEST CODE. DO NOT EDIT - */ - -const onSuccessEnglish = () => { - console.log("Payment successful! Thank you!"); -}; -const onFailEnglish = () => { - console.log("You do not have enough money to make this payment."); -}; - -const onSuccessDutch = () => { - console.log("Betaling geslaagd! Dank u!"); -}; -const onFailDutch = () => { - console.log("U heeft niet voldoende saldo om deze betaling te doen."); -}; - -donateMoney(100, onSuccessEnglish, onFailEnglish); -console.log(bankAccount); - -payRent(100, onSuccessEnglish, onFailEnglish); -console.log(bankAccount); - -donateMoney(100, onSuccessDutch, onFailDutch); -console.log(bankAccount); - -/** -* The console should print out the following: -Payment successful! Thank you! -{ -currentBalance: 150, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' } -] -} -Payment successful! Thank you! -{ -currentBalance: 50, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' }, - { prevAmount: 150, newAmount: 50, reason: 'Rent' } -] -} -U heeft niet voldoende saldo om deze betaling te doen. -{ -currentBalance: 50, -transactions: [ - { prevAmount: 350, newAmount: 250, reason: 'Donation' }, - { prevAmount: 250, newAmount: 150, reason: 'Donation' }, - { prevAmount: 150, newAmount: 50, reason: 'Rent' } -] -} -* -*/ diff --git a/Week3/prep-exercises/1-hyf-program/1-find-mentors.js b/Week3/prep-exercises/1-hyf-program/1-find-mentors.js deleted file mode 100644 index 72baa61..0000000 --- a/Week3/prep-exercises/1-hyf-program/1-find-mentors.js +++ /dev/null @@ -1,26 +0,0 @@ -import { modules, students, mentors, classes } from "./hyf.js"; - -/** - * Tjebbe would like help to get a list of possible mentors for a module. - * Fill in this function that finds all the mentors that can teach the given module. - * - * It should return an array of names. So something like: - * ['John', 'Mary'] - */ -const possibleMentorsForModule = (moduleName) => { - // TODO complete this function -}; -// You can uncomment out this line to try your function -// console.log(possibleMentorsForModule('using-apis')); - -/** - * Tjebbe wants to make it even easier for himself. - * Fill in this function that chooses a random mentor to teach the given module. - * - * It should return a single name. - */ -const findMentorForModule = (moduleName) => { - // TODO complete this function -}; -// You can uncomment out this line to try your function -// console.log(findMentorForModule('javascript')); diff --git a/Week3/prep-exercises/1-hyf-program/2-class-list.js b/Week3/prep-exercises/1-hyf-program/2-class-list.js deleted file mode 100644 index 44d2798..0000000 --- a/Week3/prep-exercises/1-hyf-program/2-class-list.js +++ /dev/null @@ -1,36 +0,0 @@ -import { modules, students, mentors, classes } from "./hyf.js"; - -/** - * We would like to have a list of everyone that is currently participating in a class. - * This means the students, but also the mentors that are currently teaching the class. - * The students should be self explanatory, but to find the mentors you will need to follow these steps: - * - Check what the `currentModule` of the class is - * - Find the mentor(s) that are `nowTeaching` that module - * - * Should return the list of names and their roles. So something like: - * - * [{ name: 'John', role: 'student' }, { name: 'Mary', role: 'mentor' }] - */ -const getPeopleOfClass = (className) => { - // TODO complete this function -}; -// You can uncomment out this line to try your function -// console.log(getPeopleOfClass('class34')); - -/** - * We would like to have a complete overview of the current active classes. - * First find the active classes, then for each get the people of that class. - * - * Should return an object with the class names as properties. - * Each class name property contains an array identical to the return from `getPeopleFromClass`. So something like: - * - * { - * class34: [{ name: 'John', role: 'student' }, { name: 'Mary', role: 'mentor' }], - * class35: [{ name: 'Jane', role: 'student' }, { name: 'Steve', role: 'mentor' }] - * } - */ -const getActiveClasses = () => { - // TODO complete this function -}; -// You can uncomment out this line to try your function -// console.log(getActiveClasses()); diff --git a/Week3/prep-exercises/1-hyf-program/README.md b/Week3/prep-exercises/1-hyf-program/README.md deleted file mode 100644 index 3f82e28..0000000 --- a/Week3/prep-exercises/1-hyf-program/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# Prep exercise - HackYourFuture program - -This week is all about combining everything we know and learning how to solve problems. To help with that, we're going to do some exercises using the data structure of the HackYourFuture program we made in week 1. As it is a prep exercise, it is something you can do together to get to the solution! Have a look at the `index.js` file for the instructions. - -## Things to think about - -After completing the exercise, have a think about the following things: - -- We split the functions into multiple files. Why do you think we do that? -- Note how some functions can be used by others to solve its problem. A lot of times when we are stuck in programming it is because we are trying to solve everything at once. It then helps to split the problem up into steps! diff --git a/Week3/prep-exercises/1-hyf-program/hyf.js b/Week3/prep-exercises/1-hyf-program/hyf.js deleted file mode 100644 index c06c02c..0000000 --- a/Week3/prep-exercises/1-hyf-program/hyf.js +++ /dev/null @@ -1,84 +0,0 @@ -export const modules = [ - { name: "html-css", displayName: "HTML/CSS" }, - { name: "javascript", displayName: "JavaScript" }, - { name: "browsers", displayName: "Browsers" }, - { name: "using-apis", displayName: "Using APIs" }, - { name: "node", displayName: "Node.js" }, - { name: "databases", displayName: "Databases" }, - { name: "react", displayName: "React" }, - { name: "project", displayName: "Project" }, -]; - -export const classes = [ - { - name: "class32", - startDate: "23-3-2021", - active: false, - graduationDate: "7-11-2021", - }, - { - name: "class33", - startDate: "28-5-2021", - active: false, - graduationDate: "7-11-2021", - }, - { - name: "class34", - startDate: "2-9-2021", - active: true, - currentModule: "react", - }, - { - name: "class35", - startDate: "14-11-2021", - active: true, - currentModule: "using-apis", - }, - { - name: "class36", - startDate: "5-1-2022", - active: true, - currentModule: "javascript", - }, -]; - -export const students = [ - { name: "Fede", class: "class33", gitHubName: "fedefu", graduated: false }, - { name: "Tjebbe", class: "class32", gitHubName: "Tjebbee", graduated: true }, - { name: "Rob", class: "class34", gitHubName: "robvk", graduated: false }, - { - name: "Wouter", - class: "class35", - gitHubName: "wouterkleijn", - graduated: false, - }, -]; - -export const mentors = [ - { - name: "Stas", - canTeach: ["javascript", "browsers", "using-apis"], - nowTeaching: "javascript", - }, - { - name: "Andrej", - canTeach: ["using-apis", "node"], - }, - { - name: "Shriyans", - canTeach: ["react"], - nowTeaching: "react", - }, - { - name: "Yash", - canTeach: ["javascript", "using-apis"], - }, - { - name: "Rohan", - canTeach: ["html/css/git", "javascript", "node"], - }, - { - name: "Collin", - canTeach: ["browsers", "using-apis", "node"], - }, -]; diff --git a/Week3/prep-exercises/1-hyf-program/package.json b/Week3/prep-exercises/1-hyf-program/package.json deleted file mode 100644 index 5f40070..0000000 --- a/Week3/prep-exercises/1-hyf-program/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "1-hyf-program", - "version": "1.0.0", - "description": "This week is all about combining everything we know and learning how to solve problems. To help with that, we're going to do some exercises using the data structure of the HackYourFuture program we made in week 1. As it is a prep exercise, it is something you can do together to get to the solution! Have a look at the `index.js` file for the instructions.", - "main": "1-find-mentors.js", - "type": "module", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "author": "", - "license": "ISC" -} diff --git a/Week4/prep-exercises/1-wallet/ex1-closure-example.js b/Week4/prep-exercises/1-wallet/ex1-closure-example.js index e98b056..209c362 100644 --- a/Week4/prep-exercises/1-wallet/ex1-closure-example.js +++ b/Week4/prep-exercises/1-wallet/ex1-closure-example.js @@ -1,3 +1,4 @@ +"use strict"; import eurosFormatter from "./euroFormatter.js"; /** diff --git a/Week4/prep-exercises/1-wallet/ex2-classes.js b/Week4/prep-exercises/1-wallet/ex2-classes.js index f016137..446cb88 100644 --- a/Week4/prep-exercises/1-wallet/ex2-classes.js +++ b/Week4/prep-exercises/1-wallet/ex2-classes.js @@ -1,8 +1,11 @@ -import eurosFormatter from './euroFormatter.js'; +"use strict"; +import eurosFormatter from "./euroFormatter.js"; class Wallet { #name; #cash; + #dailyAllowance = 40; + #dayTotalWithdrawals = 0; constructor(name, cash) { this.#name = name; @@ -23,7 +26,13 @@ class Wallet { return 0; } + if (this.#dayTotalWithdrawals + amount > this.#dailyAllowance) { + console.log(`Insufficient remaining daily allowance!`); + return 0; + } + this.#cash -= amount; + this.#dayTotalWithdrawals += amount; return amount; } @@ -36,6 +45,16 @@ class Wallet { const withdrawnAmount = this.withdraw(amount); wallet.deposit(withdrawnAmount); } + setDailyAllowance(newAllowance) { + this.#dailyAllowance = newAllowance; + console.log( + `Daily allowance set to: ${eurosFormatter.format(newAllowance)}` + ); + } + + resetDailyAllowance() { + this.#dayTotalWithdrawals = 0; + } reportBalance() { console.log( @@ -45,11 +64,15 @@ class Wallet { } function main() { - const walletJack = new Wallet('Jack', 100); - const walletJoe = new Wallet('Joe', 10); - const walletJane = new Wallet('Jane', 20); + const walletJack = new Wallet("Jack", 100); + console.log(typeof walletJack); + const walletJoe = new Wallet("Joe", 10); + const walletJane = new Wallet("Jane", 20); walletJack.transferInto(walletJoe, 50); + walletJack.setDailyAllowance(80); + walletJack.transferInto(walletJoe, 50); + walletJane.transferInto(walletJoe, 25); walletJane.deposit(20); diff --git a/Week4/prep-exercises/1-wallet/ex3-object.js b/Week4/prep-exercises/1-wallet/ex3-object.js index e94faac..e67fe88 100644 --- a/Week4/prep-exercises/1-wallet/ex3-object.js +++ b/Week4/prep-exercises/1-wallet/ex3-object.js @@ -1,9 +1,12 @@ -import eurosFormatter from './euroFormatter.js'; +"use strict"; +import eurosFormatter from "./euroFormatter.js"; function createWallet(name, cash = 0) { return { _name: name, _cash: cash, + _dailyAllowance: 40, + _dayTotalWithdrawals: 0, deposit: function (amount) { this._cash += amount; @@ -14,6 +17,10 @@ function createWallet(name, cash = 0) { console.log(`Insufficient funds!`); return 0; } + if (this._dayTotalWithdrawals + amount > this._dailyAllowance) { + console.log(`Insufficient remaining daily allowance!`); + return 0; + } this._cash -= amount; return amount; @@ -29,6 +36,17 @@ function createWallet(name, cash = 0) { wallet.deposit(withdrawnAmount); }, + setDailyAllowance: function (newAllowance) { + this._dailyAllowance = newAllowance; + console.log( + `Daily allowance set to: ${eurosFormatter.format(newAllowance)}` + ); + }, + + resetDailyAllowance: function () { + this._dayTotalWithdrawals = 0; + }, + reportBalance: function () { console.log( `Name: ${this._name}, balance: ${eurosFormatter.format(this._cash)}` @@ -42,11 +60,14 @@ function createWallet(name, cash = 0) { } function main() { - const walletJack = createWallet('Jack', 100); - const walletJoe = createWallet('Joe', 10); - const walletJane = createWallet('Jane', 20); + const walletJack = createWallet("Jack", 100); + const walletJoe = createWallet("Joe", 10); + const walletJane = createWallet("Jane", 20); walletJack.transferInto(walletJoe, 50); + walletJack.setDailyAllowance(80); + walletJack.transferInto(walletJoe, 50); + walletJane.transferInto(walletJoe, 25); walletJane.deposit(20); diff --git a/Week4/prep-exercises/1-wallet/ex4-object-shared-methods.js b/Week4/prep-exercises/1-wallet/ex4-object-shared-methods.js index bd4fd20..58af915 100644 --- a/Week4/prep-exercises/1-wallet/ex4-object-shared-methods.js +++ b/Week4/prep-exercises/1-wallet/ex4-object-shared-methods.js @@ -1,4 +1,5 @@ -import eurosFormatter from './euroFormatter.js'; +"use strict"; +import eurosFormatter from "./euroFormatter.js"; function deposit(amount) { this._cash += amount; @@ -9,8 +10,13 @@ function withdraw(amount) { console.log(`Insufficient funds!`); return 0; } + if (this._dayTotalWithdrawals + amount > this._dailyAllowance) { + console.log(`Insufficient remaining daily allowance!`); + return 0; + } this._cash -= amount; + this._dayTotalWithdrawals += amount; return amount; } @@ -34,10 +40,22 @@ function getName() { return this._name; } +function resetDailyAllowance() { + this._dayTotalWithdrawals = 0; +} + +function setDailyAllowance(amount) { + this._dailyAllowance = amount; +} + function createWallet(name, cash = 0) { return { _name: name, _cash: cash, + _dailyAllowance: 40, + _dayTotalWithdrawals: 0, + resetDailyAllowance, + setDailyAllowance, deposit, withdraw, transferInto, @@ -47,11 +65,14 @@ function createWallet(name, cash = 0) { } function main() { - const walletJack = createWallet('Jack', 100); - const walletJoe = createWallet('Joe', 10); - const walletJane = createWallet('Jane', 20); + const walletJack = createWallet("Jack", 100); + const walletJoe = createWallet("Joe", 10); + const walletJane = createWallet("Jane", 20); walletJack.transferInto(walletJoe, 50); + walletJack.setDailyAllowance(80); + walletJack.transferInto(walletJoe, 50); + walletJane.transferInto(walletJoe, 25); walletJane.deposit(20); diff --git a/Week4/prep-exercises/1-wallet/ex5-prototype.js b/Week4/prep-exercises/1-wallet/ex5-prototype.js index 7cba410..1ec2a74 100644 --- a/Week4/prep-exercises/1-wallet/ex5-prototype.js +++ b/Week4/prep-exercises/1-wallet/ex5-prototype.js @@ -1,8 +1,11 @@ -import eurosFormatter from './euroFormatter.js'; +"use strict"; +import eurosFormatter from "./euroFormatter.js"; function Wallet(name, cash) { this._name = name; this._cash = cash; + this._dailyAllowance = 40; + this._dayTotalWithdrawals = 0; } Wallet.prototype.deposit = function (amount) { @@ -14,8 +17,13 @@ Wallet.prototype.withdraw = function (amount) { console.log(`Insufficient funds!`); return 0; } + if (this._dayTotalWithdrawals + amount > this._dailyAllowance) { + console.log(`Insufficient remaining daily allowance!`); + return 0; + } this._cash -= amount; + this._dayTotalWithdrawals += amount; return amount; }; @@ -29,6 +37,14 @@ Wallet.prototype.transferInto = function (wallet, amount) { wallet.deposit(withdrawnAmount); }; +Wallet.prototype.setDailyAllowance = function (amount) { + this._dailyAllowance = amount; +}; + +Wallet.prototype.resetDailyWithdrawals = function () { + this._dayTotalWithdrawals = 0; +}; + Wallet.prototype.reportBalance = function () { console.log( `Name: ${this._name}, balance: ${eurosFormatter.format(this._cash)}` @@ -40,11 +56,14 @@ Wallet.prototype.getName = function () { }; function main() { - const walletJack = new Wallet('Jack', 100); - const walletJoe = new Wallet('Joe', 10); - const walletJane = new Wallet('Jane', 20); + const walletJack = new Wallet("Jack", 100); + const walletJoe = new Wallet("Joe", 10); + const walletJane = new Wallet("Jane", 20); walletJack.transferInto(walletJoe, 50); + walletJack.setDailyAllowance(80); + walletJack.transferInto(walletJoe, 50); + walletJane.transferInto(walletJoe, 25); walletJane.deposit(20); diff --git a/Week4/prep-exercises/1-wallet/package.json b/Week4/prep-exercises/1-wallet/package.json new file mode 100644 index 0000000..ae219ff --- /dev/null +++ b/Week4/prep-exercises/1-wallet/package.json @@ -0,0 +1,5 @@ +{ + + "type": "module" + + } \ No newline at end of file diff --git a/assets/black-box-input-output.png b/assets/black-box-input-output.png deleted file mode 100644 index 193dfd6..0000000 Binary files a/assets/black-box-input-output.png and /dev/null differ diff --git a/assets/do_while.jpg b/assets/do_while.jpg deleted file mode 100644 index cf75f96..0000000 Binary files a/assets/do_while.jpg and /dev/null differ diff --git a/assets/for_loop.jpg b/assets/for_loop.jpg deleted file mode 100644 index 4966f6b..0000000 Binary files a/assets/for_loop.jpg and /dev/null differ diff --git a/assets/humanbody.jpg b/assets/humanbody.jpg deleted file mode 100644 index e7b4274..0000000 Binary files a/assets/humanbody.jpg and /dev/null differ diff --git a/assets/image-datatypes.jpg b/assets/image-datatypes.jpg deleted file mode 100644 index 100a954..0000000 Binary files a/assets/image-datatypes.jpg and /dev/null differ diff --git a/assets/javascript.png b/assets/javascript.png deleted file mode 100644 index b8a8e12..0000000 Binary files a/assets/javascript.png and /dev/null differ diff --git a/assets/new-pull-request.png b/assets/new-pull-request.png deleted file mode 100644 index 374766b..0000000 Binary files a/assets/new-pull-request.png and /dev/null differ diff --git a/assets/scopes.png b/assets/scopes.png deleted file mode 100644 index a5f7bef..0000000 Binary files a/assets/scopes.png and /dev/null differ diff --git a/assets/submit-homework.png b/assets/submit-homework.png deleted file mode 100644 index 9d577a5..0000000 Binary files a/assets/submit-homework.png and /dev/null differ diff --git a/assets/week1-uday.png b/assets/week1-uday.png deleted file mode 100644 index 93f88c6..0000000 Binary files a/assets/week1-uday.png and /dev/null differ diff --git a/assets/weekflow.png b/assets/weekflow.png deleted file mode 100644 index 9da0971..0000000 Binary files a/assets/weekflow.png and /dev/null differ diff --git a/assets/while-loop.jpg b/assets/while-loop.jpg deleted file mode 100644 index 1cfc049..0000000 Binary files a/assets/while-loop.jpg and /dev/null differ diff --git a/hand-in-assignments-guide.md b/hand-in-assignments-guide.md deleted file mode 100644 index 67c6820..0000000 --- a/hand-in-assignments-guide.md +++ /dev/null @@ -1,88 +0,0 @@ -# How to hand in the weekly assignment - -In this module you'll submit your assignment only using GIT and GitHub. - -1. [GitHub](https://www.github.com/HackYourFuture/JavaScript) - -## 1. GitHub assignment guide - -HYF Video - -Watch the video (by clicking the image) or go through the following walk-through to learn how to submit your assignment: - -ONE TIME ONLY (START OF EVERY MODULE) - -1. Create a [fork](https://help.github.com/en/articles/fork-a-repo) of the assignment module repository. For JavaScript (as well as the next 2 modules), the assignment module repository is `https://www.github.com/HackYourHomework/Assignment-cohortXX` where XX is your cohort number. You do this by using the `fork` option on the top right. -2. Navigate to the URL of the cloned repository (it should be in your personal GitHub account, under "repositories"). -3. Clone the repository, using SSH¹, to your local machine. You can do this by typing in `git clone ` in the command line. -4. On your local machine, navigate to the folder using the command line. -5. Make sure you've cloned it correctly by running `git status` from the command line. -6. This assignment repository is a little special, have a look through the README how it all works! - -EVERY WEEK - -1. Do a `git pull` on your main branch to get the latest version. -2. Create a new branch for each week you have assignment. For example, for the assignment week 3² for JavaScript create a branch called `YOUR_NAME-w3-JavaScript`. Don't forget to checkout this branch after creating it. You should not modify the `main` branch. -3. Make your assignment! -4. Once you're finished, add your assignment to a commit. There will be some test and config files added by the test runner, this is expected and should be added! -5. Create the commit (`git commit`). Make the commit message meaningful, for example `Finished project for assignment week 3`. -6. Push the branch to your forked repository. -7. On the GitHub page of your forked repository, click on the `create pull request` button. Make sure the `base repository` is the `Assignment-cohortXX` repository, on branch `main`. -8. Give the pull request a title in the following format: - -```markdown -Assignment week 3 -``` - -9. Submit the pull request from your forked repository branch into the `main` branch. - -If you have any questions or if something is not entirely clear ¯\\\_(ツ)\_/¯, please ask/comment on Slack! - -Notes: - -1. If you are in an AZC you may need to use HTTPS instead as the AZC may have blocked the network protocol used by SSH. -2. This first week for which you need to submit assignment is week 3 of the JavaScript module. - -# Assignments Review Process - -## Before you start -1. You get assigned a mentor at the start of the module in the slack group chat. (S)He is responsible for reviewing your work for the duration of the module. -3. Please don't hesitate to contact Joséphine or the cohort supervisor if you are facing any issues. We are here to help you out! - -## Review process -Together with the mentor and other trainees in your group you have the freedom to decide on the way of communication. You can do video calls or get feedback via comments to the PR. - -The mentor will start a group message on Slack and agree together on the way of communication. There, the mentor can keep the whole group informed of his/her availability and updates. - - -### Video calls -If your group chooses to do video calls, there're 2 options. Individual calls or a group call. - -Please write down some questions before te start of the call. During the call it is important to make notes of the feedback from the mentor, so you know what has to be adjusted afterwards. - -### Comments to the PR -The mentor will place comments on your pull request. You have to adjust your work accordingly and reply on the feedback. - -### Timeline feedback -| Days | Activities | -| --- | --- | -|Tuesday (week 1) | Deadline for you to hand in your first version | -|Wednesday (week 1) - Tuesday (week 2) | Mentor provides feedback | -| Wednesday (week 2) - Tuesday (week 3) | you improve the assignment based on the feedback and mentor evaluates improvements | -| Wednesday (week 3) | Core-team member Assignment Approval Check. At this point every PR needs to be approved. | - -It can happen that your mentor doesn't reply on your questions or your updated assignment. Please send a reminder via slack. If that doesn't work and you're afraid you can't make the deadline, contact your cohort supervisor. - -### Labels -It is important for the you and the core-team to have up to date info about the status of the assignment. This is why the mentors use two labels on your PR. - -| Label | Description | -| --- | --- | -|no label |not reviewed yet | -|Needs work |reviewed, but you need to implement feedback | -|Approved |reviewed, and your assignment has been approved | - -Here is an example of this in action. - -![labels](https://github.com/HackYourFuture/mentors/blob/main/assets/labels.png) -