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

Skip to content

Commit 660fe2d

Browse files
committed
updated step 5 of homework week 7
1 parent 09c04ff commit 660fe2d

File tree

1 file changed

+74
-26
lines changed

1 file changed

+74
-26
lines changed

Week7/MAKEME.md

Lines changed: 74 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Give feedback on Step 4 and 5 of last weeks homework. Please provide the feedbac
2222

2323
_Deadline Monday_
2424

25-
- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE.
25+
- Solve all your Git issues. DO NO CLOSE AN ISSUE WITHOUT AN EXPLANATION OR CODE COMMIT REFERENCING THAT ISSUE.
2626

2727

2828
## Step 3: Fix issues
@@ -37,7 +37,7 @@ _Deadline Saturday_
3737

3838
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.'
3939

40-
Also make:
40+
Also make:
4141

4242
1. [Comparisons with the Logical And Operator](https://www.freecodecamp.com/challenges/comparisons-with-the-logical-and-operator)
4343

@@ -49,38 +49,86 @@ Also make:
4949

5050
_Deadline Wednesday_
5151

52+
Complete the following code:
53+
5254
```js
53-
// Inspired by the lesson.
54-
// Create the following objects: Movies, Staff.
55-
56-
//Fill the following methods:
57-
Movies {
58-
getStars()
59-
getWrites()
60-
getDirector()
61-
getRating()
62-
rate()
55+
class Movie {
56+
constructor(title, director) {
57+
// add your code here
58+
}
59+
60+
getTitle() {
61+
// add your code here
62+
}
63+
64+
getDirector() {
65+
// add your code here
66+
}
67+
68+
addStar(star) {
69+
// add your code here
70+
}
71+
72+
getStars() {
73+
// add your code here
74+
}
75+
76+
addWriter(writer) {
77+
// add your code here
78+
}
79+
80+
getWriters() {
81+
// add your code here
82+
}
83+
84+
addRating(rating) {
85+
// add your code here
86+
}
87+
88+
getAverageRating() {
89+
// add your code here
90+
}
91+
6392
// ... Add yours :-) Look to IMDB for inspiration
6493
}
6594

66-
Staff {
67-
getName()
68-
getRole()
69-
getAge()
70-
// ... Add yours :-) Look to IMDB for inspiration
95+
class StaffMember {
96+
constructor(name, role, dateOfBirth) {
97+
// add your code here
98+
}
99+
100+
addMovie(movie) {
101+
// add your code here
102+
}
103+
104+
getName() {
105+
// add your code here
106+
}
107+
108+
getRole() {
109+
// add your code here
110+
}
111+
112+
getAge() {
113+
// add your code here
114+
}
71115
}
72116

73-
// Initialize the objects
74-
// by pick your favorite movie from http://www.imdb.com/
75-
// and make sure that the following actions work.
76-
console.log(InstanceMovie.getStars().map(actor => `${actor.getName()} ${actor.getAge()}`));
77-
const director = InstanceMovie.getDirector();
117+
// Pick your favorite movie from http://www.imdb.com/
118+
119+
const myMovie = new Movie(...);
120+
121+
const firstActor = new StaffMember(...);
122+
myMovie.addStar(firstActor);
123+
// create and add more staff members
124+
125+
// Make sure that the following actions work.
126+
console.log(myMovie.getStars().map(actor => `${actor.getName()} ${actor.getAge()}`));
127+
const director = myMovie.getDirector();
78128
console.log(`Director: ${director.map(director => `${director.getName()}`)}`);
79-
// Be creative with this let's see what you come up with :-)
80129
```
81130

82-
Fun extra step: If you get bored, template them and make a page by rendering the results in HTML :slightly_smiling_face:
83-
with something like `document.querySelector('.move').innerHTML = MovieHTML`
131+
Fun extra step: If you get bored, template them and make a page by rendering the results in HTML :smile: with something like `document.querySelector('.move').innerHTML = ...`
84132

85133
## Step 6: Read before next lecture
86134

@@ -115,7 +163,7 @@ Remember the person with the most kata points gets a prize from Gijs (and you ca
115163
1. [Stacks/Queues](https://www.youtube.com/watch?v=wjI1WNcIntg) (5 mins)
116164
2. [JS Event Loops](https://www.youtube.com/watch?v=8aGhZQkoFbQ) (26 mins, watch this one twice or until you understand it)
117165

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

0 commit comments

Comments
 (0)