|
1 | 1 | // CODE here for your Lambda Classes |
| 2 | +//Person class |
| 3 | +class Person{ |
| 4 | + constructor(props){ |
| 5 | + this.name = props.name; |
| 6 | + this.age = props.age; |
| 7 | + this.location = props.location; |
| 8 | + this.gender = props.gender; |
| 9 | + } |
| 10 | + speak(){ |
| 11 | + return `Hello my name is ${this.name} I am from ${this.location}`; |
| 12 | + } |
| 13 | +} |
| 14 | + |
| 15 | +class Instructor extends Person{ |
| 16 | + constructor(props){ |
| 17 | + super(props); |
| 18 | + this.specialty = props.specialty; |
| 19 | + this.favLanguage = props.favLanguage; |
| 20 | + this.catchPhrase = props.catchPhrase; |
| 21 | + } |
| 22 | + demo(subject){ |
| 23 | + return `Today we are learning about ${subject}`; |
| 24 | + } |
| 25 | + grade(student, subject){ |
| 26 | + return `${student.name} receives a perfect score on ${subject}`; |
| 27 | + } |
| 28 | +} |
| 29 | + |
| 30 | +class Student extends Person{ |
| 31 | + constructor(props){ |
| 32 | + super(props); |
| 33 | + this.previousBackground = props.previousBackground; |
| 34 | + this.className = props.className; |
| 35 | + this.favSubjects = props.favSubjects; |
| 36 | + } |
| 37 | + listsSubjects(){ |
| 38 | + for(let i = 0; i < this.favSubjects.length; i++){console.log(this.favSubjects[i]);} |
| 39 | + } |
| 40 | + PRAssignment(sub){ |
| 41 | + return `${this.name} has submitted a PR for ${sub}.` |
| 42 | + } |
| 43 | + sprintChallenge(sub){ |
| 44 | + return `${this.name} has begun sprint challenge on ${sub};` |
| 45 | + } |
| 46 | +} |
| 47 | + |
| 48 | +class ProjectManagers extends Instructor{ |
| 49 | + constructor(props){ |
| 50 | + super(props); |
| 51 | + this.gradClassName = props.gradClassName; |
| 52 | + this.favInstructor = props.favInstructor; |
| 53 | + } |
| 54 | + standUp(chan){ |
| 55 | + return `${this.name} announces to ${chan}, @channel standy times!`; |
| 56 | + } |
| 57 | + debugsCode(student, subject){ |
| 58 | + return `${this.name} debugs ${student}'s code on ${subject}`; |
| 59 | + } |
| 60 | +} |
| 61 | + |
| 62 | +const Ryan = new Person({ |
| 63 | + name: 'Ryan', |
| 64 | + location: 'Atlanta', |
| 65 | + age: 33, |
| 66 | + gender: 'male', |
| 67 | + }); |
| 68 | + const Jones = new Person({ |
| 69 | + name: 'Jones', |
| 70 | + location: 'Atlanta', |
| 71 | + age: 29, |
| 72 | + gender: 'male', |
| 73 | + }); |
| 74 | + const Quinn = new Instructor ({ |
| 75 | + name: 'Quinn', |
| 76 | + location: 'Atlanta', |
| 77 | + age: 33, |
| 78 | + gender: 'male', |
| 79 | + specialty: 'Defense', |
| 80 | + favLanguage: 'python', |
| 81 | + catchPhrase: 'defense almost wins championships...fn patriots' |
| 82 | + }); |
| 83 | + const Manuel = new Instructor ({ |
| 84 | + name: 'Manuel', |
| 85 | + location: 'Atlanta', |
| 86 | + age: 39, |
| 87 | + gender: 'male', |
| 88 | + specialty: 'Defense', |
| 89 | + favLanguage: 'javascript', |
| 90 | + catchPhrase: 'dont come in this danger zone half-steppin' |
| 91 | + }); |
| 92 | + const Freeman = new Student ({ |
| 93 | + name: 'Freeman', |
| 94 | + location: 'Atlanta', |
| 95 | + age: 26, |
| 96 | + gender: 'male', |
| 97 | + specialty: 'runnin that rock', |
| 98 | + favLanguage: '.Net', |
| 99 | + catchPhrase: 'just give me the ball and watch me work', |
| 100 | + previousBackground: 'worked at a funeral home', |
| 101 | + className: 'webpt4', |
| 102 | + favSubjects: ['mobile', 'networking', 'linux',] |
| 103 | + }); |
| 104 | + const Sanu = new Student ({ |
| 105 | + name: 'Sanu', |
| 106 | + location: 'Atlanta', |
| 107 | + age: 29, |
| 108 | + gender: 'male', |
| 109 | + specialty: 'going to get it', |
| 110 | + favLanguage: 'C', |
| 111 | + catchPhrase: 'im just gonna go get it, stop me', |
| 112 | + previousBackground: 'orange and black pack', |
| 113 | + className: 'webpt4', |
| 114 | + favSubjects: ['hardware', 'arduino', 'raspberry pi',] |
| 115 | + }); |
| 116 | + const Neal = new ProjectManagers ({ |
| 117 | + name: 'Neal', |
| 118 | + location: 'Atlanta', |
| 119 | + age: 23, |
| 120 | + gender: 'male', |
| 121 | + specialty: 'making people feel it in the worst way', |
| 122 | + favLanguage: 'Java', |
| 123 | + catchPhrase: "everytime you see me it'll be from your back", |
| 124 | + previousBackground: 'the swamp land', |
| 125 | + className: 'webpt4', |
| 126 | + favSubjects: ['ruby', 'sql', 'networking',], |
| 127 | + gradClassName: 'Gators', |
| 128 | + favInstructor: 'Quinn' |
| 129 | + }); |
| 130 | + const DJones = new ProjectManagers ({ |
| 131 | + name: 'DJones', |
| 132 | + location: 'Atlanta', |
| 133 | + age: 24, |
| 134 | + gender: 'male', |
| 135 | + specialty: 'all things lb', |
| 136 | + favLanguage: 'Android', |
| 137 | + catchPhrase: "fillin holes and strikin fear in nick foles", |
| 138 | + previousBackground: 'tiger country', |
| 139 | + className: 'webpt4', |
| 140 | + favSubjects: ['html', 'css', 'react',], |
| 141 | + gradClassName: 'Tigers', |
| 142 | + favInstructor: 'Quinn' |
| 143 | + }); |
| 144 | +console.log(Ryan); |
| 145 | +console.log(Jones.speak()); |
| 146 | +console.log(Quinn.catchPhrase); |
| 147 | +console.log(Manuel.speak()); |
| 148 | +console.log(Freeman.listsSubjects()); |
| 149 | +console.log(Sanu.PRAssignment('JS-IV')); |
| 150 | +console.log(Neal.catchPhrase); |
| 151 | +console.log(DJones.debugsCode(Sanu.name, 'JS-IV')); |
| 152 | + |
| 153 | + |
0 commit comments