-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Expand file tree
/
Copy pathlambda-classes.js
More file actions
199 lines (162 loc) · 4.15 KB
/
lambda-classes.js
File metadata and controls
199 lines (162 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
// CODE here for your Lambda Classes
class Person{
constructor(attributes){
this.name = attributes.name;
this.age = attributes.age;
this.location = attributes.location
}
speak(){
return `Hello my name is ${this.name}, I am from ${this.location}`;
};
}
class Instructor extends Person{
constructor(attributes){
super(attributes);
this.specialty = attributes.specialty;
this.favLanguage = attributes.favLanguage;
this.catchPhrase = attributes.catchPhrase
}
demo(){
return `Today we are learning about ${this.specialty}`;
};
grade(){
return `${this.name} receives a perfect score on ${this.specialty}`;
};
add(){
return `Let's give ${this.name} 10 extra points for effort!`;
};
sub(){
return ` ${this.name} will suffer 10 extra points off for not finishing the project!`;
};
}
class Student extends Person{
constructor(attributes){
super(attributes);
this.previousBackground = attributes.previousBackground;
this.className = attributes.className;
this.favSubjects = attributes.favSubjects
}
functionlistSubjects(){
this.favSubjects.forEach(element => {console.log(element)})
}
PRAssignment(){
return `${this.name} has submitted a PR for ${this.className}`;
};
sprintChallenge(){
return ` ${this.name} has begun sprint challenge on ${this.className}`;
};
}
class ProjectManager extends Instructor{
constructor(attributes){
super(attributes);
this.gradClassName = attributes.gradClassName;
this.favInstructor = attributes.favInstructor
}
standUp(){
return `${this.name} announces ${this.gradClassName}, @channel standy times!`;
};
debugsCode(){
return `${this.name} debugs ${student.name}'s code on ${this.subject}`;
};
}
const Tom = new Person({
name: 'Tom',
age: 47,
location: 'Bed'
});
const Freddy = new Person({
name: 'Fredddy',
age: 27,
location: 'Rock'
});
const Tim = new Person({
name: 'Tim',
age: 28,
location: 'Rock-bed'
});
const F = new Instructor({
name: 'F',
location: 'Cali',
age: 27,
favLanguage: 'JavaScript',
specialty: 'Front-end',
catchPhrase: `Don't forget the food`
});
const T = new Instructor({
name: 'T',
location: 'Montana',
age: 24,
favLanguage: 'JAVA',
specialty: 'Servers',
catchPhrase: `let me SERVER you`
});
const M = new Instructor({
name: 'M',
location: 'Boston',
age: 30,
favLanguage: 'Python',
specialty: 'Back-end',
catchPhrase: `I don't bite`
});
const Ted = new Student({
name: 'Ted',
age: 22,
location: 'Denver',
previousBackground: 'chef',
className: 'Java',
favSubjects: ['math', 'science', 'biology', 'arts'],
grade: 76
})
const Andrea = new Student({
name: 'Andrea',
age: 24,
location: 'Orlando',
previousBackground: 'student',
className: 'CS',
favSubjects: ['English', 'Econ', 'Marketing'],
grade: 76
})
const Ron = new Student({
name: 'Ron',
age: 22,
location: 'Boston',
previousBackground: 'runner',
className: 'Programming',
favSubjects: ['AI', 'science', 'Mobile Tec'],
grade: 80
})
const Nav = new ProjectManager({
name: 'Nav',
location: 'NYC',
age: 30,
favLanguage: 'C++',
specialty: 'Servers',
catchPhrase: `I don't bite, unless`,
gradClassName: 'Javascript',
favInstructor: 'M'
})
const Louise = new ProjectManager({
name: 'Louise',
location: 'Toronto',
age: 33,
favLanguage: 'Ruby',
specialty: 'Customer Applications',
catchPhrase: `Bit me and you'll see`,
gradClassName: 'Data Sci',
favInstructor: 'T'
})
const Hanna = new ProjectManager({
name: 'Hanna',
location: 'Galveston',
age: 25,
favLanguage: 'Python',
specialty: 'cooking',
catchPhrase: `Let's cook some Python!`,
gradClassName: 'Python',
favInstructor: 'F'
})
console.log(T.location);
console.log(M.specialty);
console.log(Louise.favLanguage);
console.log(Hanna.standUp());
console.log(Andrea.favSubjects);