forked from focused220/JavaScript-IV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda-classes.js
More file actions
153 lines (147 loc) · 4.14 KB
/
Copy pathlambda-classes.js
File metadata and controls
153 lines (147 loc) · 4.14 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
// CODE here for your Lambda Classes
//Person class
class Person{
constructor(props){
this.name = props.name;
this.age = props.age;
this.location = props.location;
this.gender = props.gender;
}
speak(){
return `Hello my name is ${this.name} I am from ${this.location}`;
}
}
class Instructor extends Person{
constructor(props){
super(props);
this.specialty = props.specialty;
this.favLanguage = props.favLanguage;
this.catchPhrase = props.catchPhrase;
}
demo(subject){
return `Today we are learning about ${subject}`;
}
grade(student, subject){
return `${student.name} receives a perfect score on ${subject}`;
}
}
class Student extends Person{
constructor(props){
super(props);
this.previousBackground = props.previousBackground;
this.className = props.className;
this.favSubjects = props.favSubjects;
}
listsSubjects(){
for(let i = 0; i < this.favSubjects.length; i++){console.log(this.favSubjects[i]);}
}
PRAssignment(sub){
return `${this.name} has submitted a PR for ${sub}.`
}
sprintChallenge(sub){
return `${this.name} has begun sprint challenge on ${sub};`
}
}
class ProjectManagers extends Instructor{
constructor(props){
super(props);
this.gradClassName = props.gradClassName;
this.favInstructor = props.favInstructor;
}
standUp(chan){
return `${this.name} announces to ${chan}, @channel standy times!`;
}
debugsCode(student, subject){
return `${this.name} debugs ${student}'s code on ${subject}`;
}
}
const Ryan = new Person({
name: 'Ryan',
location: 'Atlanta',
age: 33,
gender: 'male',
});
const Jones = new Person({
name: 'Jones',
location: 'Atlanta',
age: 29,
gender: 'male',
});
const Quinn = new Instructor ({
name: 'Quinn',
location: 'Atlanta',
age: 33,
gender: 'male',
specialty: 'Defense',
favLanguage: 'python',
catchPhrase: 'defense almost wins championships...fn patriots'
});
const Manuel = new Instructor ({
name: 'Manuel',
location: 'Atlanta',
age: 39,
gender: 'male',
specialty: 'Defense',
favLanguage: 'javascript',
catchPhrase: 'dont come in this danger zone half-steppin'
});
const Freeman = new Student ({
name: 'Freeman',
location: 'Atlanta',
age: 26,
gender: 'male',
specialty: 'runnin that rock',
favLanguage: '.Net',
catchPhrase: 'just give me the ball and watch me work',
previousBackground: 'worked at a funeral home',
className: 'webpt4',
favSubjects: ['mobile', 'networking', 'linux',]
});
const Sanu = new Student ({
name: 'Sanu',
location: 'Atlanta',
age: 29,
gender: 'male',
specialty: 'going to get it',
favLanguage: 'C',
catchPhrase: 'im just gonna go get it, stop me',
previousBackground: 'orange and black pack',
className: 'webpt4',
favSubjects: ['hardware', 'arduino', 'raspberry pi',]
});
const Neal = new ProjectManagers ({
name: 'Neal',
location: 'Atlanta',
age: 23,
gender: 'male',
specialty: 'making people feel it in the worst way',
favLanguage: 'Java',
catchPhrase: "everytime you see me it'll be from your back",
previousBackground: 'the swamp land',
className: 'webpt4',
favSubjects: ['ruby', 'sql', 'networking',],
gradClassName: 'Gators',
favInstructor: 'Quinn'
});
const DJones = new ProjectManagers ({
name: 'DJones',
location: 'Atlanta',
age: 24,
gender: 'male',
specialty: 'all things lb',
favLanguage: 'Android',
catchPhrase: "fillin holes and strikin fear in nick foles",
previousBackground: 'tiger country',
className: 'webpt4',
favSubjects: ['html', 'css', 'react',],
gradClassName: 'Tigers',
favInstructor: 'Quinn'
});
console.log(Ryan);
console.log(Jones.speak());
console.log(Quinn.catchPhrase);
console.log(Manuel.speak());
console.log(Freeman.listsSubjects());
console.log(Sanu.PRAssignment('JS-IV'));
console.log(Neal.catchPhrase);
console.log(DJones.debugsCode(Sanu.name, 'JS-IV'));