diff --git a/assignments/lambda-classes.js b/assignments/lambda-classes.js index 71acfca0e..348d55c65 100644 --- a/assignments/lambda-classes.js +++ b/assignments/lambda-classes.js @@ -1 +1,81 @@ // CODE here for your Lambda Classes +class Person { + constructor(info) { + this.name= info.name; + this.age= info.age; + this.location= info.location; + this.gender= info.gender; + } + speak(){ + console.log(`Hello my name is ${this.name}, I am from ${this.location}.`); + } +} + +class Instructor extends Person { + constructor(instructorInfo){ + super(instructorInfo); + this.speacialty= instructorInfo.speacialty; + this.favLanguage= instructorInfo.favLanguage; + this.catchPhrase= instructorInfo.catchPhrase; + } + demo(subject){ + console.log(`Today we are learning about ${subject}.`); + } + grade(student,subject){ + console.log(`${student.name} earned a perfect score on ${subject}.`); + } +} + +class Student extends Person { + constructor(studentInfo){ + super(studentInfo); + this.previousBackground =studentInfo.previousBackground; + this.className= studentInfo.className; + this.favSubjects= studentInfo.favSubjects; + } + listsSubjects(){ + console.log(`${this.favSubjects}`); + } + PRAssignment(subject) { + console.log(`${student.name} has submitted a PR for ${subject}.`); + } + sprintChallenge(subject){ + console.log(`${student.name} has begun sprint challenge on ${subject}.`); + } +} + +class Pms extends Instructor{ + constructor(pmInfo){ + super(pmInfo); + this.gradClassName= pmInfo.gradClassName; + this.favInstructor= pmInfo.favInstructor; + } + standUp(channel){ + console.log(`${this.name} announces to ${channel}, @channel standup times!`); + } + debugsCode(student,subject){ + console.log(`${this.name} debugs ${student.name}'s code on ${subject}.`); + +} +} + + +const Josh= new Instructor({ + name:'Josh', + gender:'male', + favLanguage:'JavaScript', + +}); + +const Holly= new Pms({ + name:'Holly', + gender:'female', + favInstructor:'Josh' +}); + +const Jared= new Student ({ + name: 'Jared', + gender:'male', + age: 25, + className:'cs11' +}); diff --git a/assignments/prototype-refactor.js b/assignments/prototype-refactor.js index e55ae39c0..55c246a93 100644 --- a/assignments/prototype-refactor.js +++ b/assignments/prototype-refactor.js @@ -41,13 +41,15 @@ const mage = new Humanoid({ dimensions: { length: 2, width: 1, - height: 1 + height: 1, }, hp: 5, - name: 'Bruce', - faction: 'Mage Guild', - weapons: ['Staff of Shamalama'], - language: 'Common Toungue' + name: 'Thor', + faction: 'Asgardian', + weapons: [ + 'Mjolnir', + ], + language: 'Native Toungue', }); const swordsman = new Humanoid({ @@ -55,13 +57,17 @@ const swordsman = new Humanoid({ dimensions: { length: 2, width: 2, - height: 2 + height: 2, }, hp: 15, - name: 'Sir Mustachio', - faction: 'The Round Table', - weapons: ['Giant Sword', 'Shield'], - language: 'Common Toungue' + name: 'Deadpool', + faction: 'Mutant', + weapons: [ + 'Swords', + 'Guns', + 'More Guns', + ], + language: 'Sarcasm', }); const archer = new Humanoid({ @@ -69,22 +75,25 @@ const archer = new Humanoid({ dimensions: { length: 1, width: 2, - height: 4 + height: 4, }, hp: 10, - name: 'Lilith', - faction: 'Forest Kingdom', - weapons: ['Bow', 'Dagger'], - language: 'Elvish' + name: 'Joker', + faction: 'Arkham Patient ', + weapons: [ + 'Bombs', + 'Guns', + 'Mob', + ], + language: 'English 1940s street slang', }); -console.log(mage.createdAt); // Today's date -console.log(archer.dimensions); // { length: 1, width: 2, height: 4 } -console.log(swordsman.hp); // 15 -console.log(mage.name); // Bruce -console.log(swordsman.faction); // The Round Table -console.log(mage.weapons); // Staff of Shamalama -console.log(archer.language); // Elvish -console.log(archer.greet()); // Lilith offers a greeting in Elvish. -console.log(mage.takeDamage()); // Bruce took damage. -console.log(swordsman.destroy()); // Sir Mustachio was removed from the game. +console.log(mage.createdAt); +console.log(archer.dimensions); +console.log(swordsman.hp); +console.log(swordsman.faction); +console.log(mage.weapons); +console.log(archer.language); +console.log(archer.greet()); +console.log(mage.takeDamage()); +console.log(swordsman.destroy());