forked from bloominstituteoftechnology/JavaScript-IV
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlambda-classes.js
More file actions
168 lines (137 loc) · 4.63 KB
/
Copy pathlambda-classes.js
File metadata and controls
168 lines (137 loc) · 4.63 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
// CODE here for your Lambda Classes
class Person {
constructor(personAttrs) {
this.name = personAttrs.name;
this.age = personAttrs.age;
this.location = personAttrs.location;
}
speak() {
console.log(`Hello, my name is ${this.name}, I am from ${this.location}`);
}
}
class Instructor extends Person {
constructor(instructorAttrs) {
super(instructorAttrs);
this.specialty = instructorAttrs.specialty;
this.favLanguage = instructorAttrs.favLanguage;
this.catchPhrase = instructorAttrs.catchPhrase;
}
demo(subject) {
console.log(`Today we are learning about ${subject}`);
}
grade(student, subject) {
console.log(`${student.name} receives a perfect score on ${subject}`);
}
}
class Student extends Person {
constructor(studentAttrs) {
super(studentAttrs);
this.previousBackground = studentAttrs.previousBackground;
this.className = studentAttrs.className;
this.favSubjects = studentAttrs.favSubjects;
}
listsSubjects() {
this.favSubjects.forEach(element => {
console.log(element);
});
}
PRAssignment(subject) {
console.log(`${this.name} has submitted a PR for ${subject}`);
}
sprintChallenge(subject) {
console.log(`${this.name} has begun sprint challenge on ${subject}`);
}
}
class ProjectManager extends Instructor {
constructor(PMAttrs) {
super(PMAttrs);
this.gradClassName = PMAttrs.gradClassName;
this.favInstructor = PMAttrs.favInstructor;
}
standUp(slackChannel) {
console.log(`${this.name} announces to ${slackChannel}, @channel standup times!`);
}
debugCode(student, subject) {
console.log(`${this.name} debugs ${student.name}'s code on ${subject}`);
}
}
const Cameron = new Instructor({
name: "Cameron Pope",
age: 30,
location: "PotatoVille",
specialty: "Being Awesome",
favLanguage: "CSS",
catchPhrase: "yeet"
});
const Dan = new Instructor({
name: "Dan Frehner",
age: 28,
location: "Lambda School",
specialty: "Being Cam's replacement instructor",
favLanguage: "javascript",
catchPhrase: "Have a nice day!"
});
const Jacob = new ProjectManager({
name: "Jacob Angulo",
age: 24,
location: "MiniSoda",
specialty: "Being The Best PM",
favLanguage: "Python",
catchPhrase: "STANDUP TIME!",
gradClassName: "CS1",
favInstructor: "Dan Frehner"
});
const Sasha = new ProjectManager({
name: "Sasha Taylor",
age: 25,
location: "KnowWhere",
specialty: "coming in clutch when jacob isnt here",
favLanguage: "Java",
catchPhrase: "Hey guys Jacob will be out today",
gradClassName: "CS5",
favInstructor: "Cameron Pope"
});
const Liam = new Student({
name: "Liam Edlinger",
age: 20,
location: "Utah",
previousBackground: "CS stuff but no credentials so sad",
className: "WebPT7",
favSubjects: ["CS", "webdev", "potato"],
})
const Patrick = new Student({
name: "Patrick Shushereba",
age: 23,
location: "SumWhere",
previousBackground: "IDK",
className: "WebPT7",
favSubjects: ["WebDev", "computer stuffs", "potato"],
})
Liam.listsSubjects();
Patrick.listsSubjects();
Liam.speak();
Patrick.speak();
Liam.sprintChallenge("Javascript Fundamentals");
Patrick.sprintChallenge("Javascript Fundamentals");
Jacob.speak();
Sasha.speak();
Jacob.standUp("Webpt7_Jacob");
Sasha.standUp("Webpt7_Jacob");
Jacob.grade(Liam, "CS Stuff");
Sasha.grade(Patrick, "Web Dev");
Jacob.demo("Javascript");
Sasha.demo("CSS");
Jacob.debugCode(Liam, "Potatoes");
Sasha.debugCode(Patrick, "Computering");
Dan.speak();
Cameron.speak();
Dan.demo("React");
Cameron.demo("PreProccesing");
Dan.grade(Liam, "unreadable code");
Cameron.grade(Patrick, "learning real good");
console.log(`${Liam.name}, ${Liam.age}, ${Liam.className}, ${Liam.location}, ${Liam.previousBackground}`)
console.log(`${Patrick.name}, ${Patrick.age}, ${Patrick.className}, ${Patrick.location}, ${Patrick.previousBackground}`)
console.log(`${Dan.name}, ${Dan.age}, ${Dan.catchPhrase}, ${Dan.favLanguage}, ${Dan.location}, ${Dan.specialty}`);
console.log(`${Cameron.name}, ${Cameron.age}, ${Cameron.catchPhrase}, ${Cameron.favLanguage}, ${Cameron.location}, ${Cameron.specialty}`);
console.log(`${Jacob.name}, ${Jacob.age}, ${Jacob.catchPhrase}, ${Jacob.favLanguage}, ${Jacob.location}, ${Jacob.specialty}, ${Jacob.favInstructor}, ${Jacob.gradClassName}`);
console.log(`${Sasha.name}, ${Sasha.age}, ${Sasha.catchPhrase}, ${Sasha.favLanguage}, ${Sasha.location}, ${Sasha.specialty}, ${Sasha.favInstructor}, ${Sasha.gradClassName}`);