Skip to content

Latest commit

 

History

History
169 lines (114 loc) · 4.89 KB

MAKEME.md

File metadata and controls

169 lines (114 loc) · 4.89 KB

Homework Week 7

Topics discussed this week:
• Object Oriented Programming
    • this
    • call
    • apply
    • bind
• Code flow (order of execution)

Here you find the readings you have to complete before the eighth lecture.

Step 1: Give feedback

Deadline Monday

Give feedback on Step 4 and 5 of last weeks homework. Please provide the feedback in an issue.

Step 2: Issues

Deadline Monday

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

Step 3: Fix issues

Deadline Thursday

  • Fix the issues from the last weeks and make sure you explain how you fixed the issue in a comment (or commit message)

Step 4: Some Challenges

Deadline Saturday

Let's practice working with Objects and Arrays. Go to FreeCodeCamp and complete all challenges under "Object Oriented and Functional Programming" and the first four challenges under "Basic Algorithm Scripting", up until 'Find the longest word in a string.'

Also make:

  1. Comparisons with the Logical And Operator

  2. Record Collection

  3. Iterate over Arrays with map

Step 5: OOP

Deadline Wednesday

Complete the following code:

class Movie {
  constructor(title, director) {
    // add your code here
  }

  getTitle() {
    // add your code here
  }

  getDirector() {
    // add your code here
  }

  addStar(star) {
    // add your code here
  }

  getStars() {
    // add your code here
  }

  addWriter(writer) {
    // add your code here
  }

  getWriters() {
    // add your code here
  }

  addRating(rating) {
    // add your code here
  }

  getAverageRating() {
    // add your code here
  }

  // ... Add yours :-) Look to IMDB for inspiration
}

class StaffMember {
  constructor(name, role, dateOfBirth) {
    // add your code here
  }

  addMovie(movie) {
    // add your code here
  }

  getName() {
    // add your code here
  }

  getRole() {
    // add your code here
  }

  getAge() {
    // add your code here
  }
}

// Pick your favorite movie from http://www.imdb.com/

const myMovie = new Movie(...);

const firstActor = new StaffMember(...);
myMovie.addStar(firstActor);
// create and add more staff members

// Make sure that the following actions work.
console.log(myMovie.getStars().map(actor => `${actor.getName()} ${actor.getAge()}`));
const director = myMovie.getDirector();
console.log(`Director: ${director.getName()}`);

Fun extra step: If you get bored, template them and make a page by rendering the results in HTML 😄 with something like document.querySelector('.move').innerHTML = ...

Step 6: Read before next lecture

Deadline Sunday morning

Go trough the reading material in the README.md to prepare for your next class

BONUS : Code Kata Race

If you haven't already join our clan: "Hack Your Future" in codewars

Solve the following problems:

Hints

  • Hint for Q1: split your code into two parts, one part for the case that one of the two strings has an extra letter at the start or the end but is otherwise identical & one part for the case that the strings are the same length but one character is different in one of the strings
  • Also for Q1 this function on strings might be useful: JavaScript String slice() method
  • Also potentially useful: JavaScript String charAt() Method
  • Hint for Q2 Also there are no sample tests, you need to use submit

Remember the person with the most kata points gets a prize from Gijs (and you can do exercises on this website without us assigning them - anything kyu 7 or kyu 8 you can try to do - kyu 6 or lower is probably too hard) -->

-MORE BONUS 💥

To watch before the next lecture:

(watch in this order)

  1. Stacks/Queues (5 mins)
  2. JS Event Loops (26 mins, watch this one twice or until you understand it)

Create a new repository "hyf-javascript3". Also create a new folder "week1" inside this repository. Upload your homework files inside the week1 folder and write a description for this “commit”. Your hyf-javascript3/week1 should now contain the files of your homework. Place the link to your repository folder in Trello.