forked from bloominstituteoftechnology/JavaScript-IV
-
Notifications
You must be signed in to change notification settings - Fork 0
Emily lagattolla #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
elagat
wants to merge
18
commits into
master
Choose a base branch
from
emily-lagattolla
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
8813945
RPG update
elagat 11d4dae
completed protype-refactor
elagat 1ff75f3
added Instructor class to lambda-classes
elagat 7c00068
added grade function
elagat da209cd
fixed lacking super in Instructors
elagat 9805325
added PRAssignment function to Student
elagat 76df2e4
added sprintChallenge method to Student
elagat e27d9cf
const dan = new Instructor
elagat 70fcf1d
fixed parameters on Instructor method grade
elagat 22490ba
completed writing classes
elagat 6e770ba
added 2 new instructors
elagat e2027a1
completed creating instructor, student, and pm objects
elagat 89c7ac4
MVP
elagat 7b2309d
fixed string vs number
elagat b659a60
console.log for PM methods work
elagat 5b8fb5c
WIP: listsSubjects method on Students should take an array
elagat e2166ce
array invoked
elagat 78e765b
corrected typo. MVP
elagat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,155 @@ | ||
| // CODE here for your Lambda Classes | ||
|
|
||
| // Person class | ||
|
|
||
| class Person { | ||
| constructor(attrs) { | ||
| this.name = attrs.name; | ||
| this.age = attrs.age; | ||
| this.location = attrs.location; | ||
| } | ||
|
|
||
| speak() { | ||
| console.log(`Hello, my name is ${this.name}, I am from ${this.location}`); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // Instructor class | ||
|
|
||
| class Instructor extends Person { | ||
| constructor(instAttrs) { | ||
| super(instAttrs); | ||
| this.specialty = instAttrs.specialty; | ||
| this.favLanguage = instAttrs.favLanguage; | ||
| this.catchPhrase = instAttrs.catchPhrase; | ||
| } | ||
|
|
||
| demo(subject) { | ||
| console.log(`Today we are learning about ${subject}`); | ||
| } | ||
|
|
||
| grade(student, subject) { | ||
| console.log(`${student} receives a perfect score on ${subject}`) | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // Student class | ||
|
|
||
| class Student extends Person { | ||
| constructor(stuAttrs) { | ||
| super(stuAttrs); | ||
| this.previousBackground = stuAttrs.previousBackground; | ||
| this.className = stuAttrs.className; | ||
| this.favSubjects = [stuAttrs.favSubjects]; | ||
| } | ||
|
|
||
| listsSubjects() { | ||
| console.log(`${this.favSubjects}`); | ||
| } | ||
|
|
||
| PRAssignment() { | ||
| console.log(`${this.name} has submitted a PR for ${this.subject}`); | ||
| } | ||
|
|
||
| sprintChallenge() { | ||
| console.log(`${this.name} has begun sprint challenge for ${this.subject}`); | ||
| } | ||
| } | ||
|
|
||
|
|
||
| // ProjectManager class | ||
|
|
||
| class ProjectManager extends Instructor { | ||
| constructor(pmAttrs) { | ||
| super(pmAttrs); | ||
| this.gradClassName = pmAttrs.gradClassName; | ||
| this.favInstructor = pmAttrs.favInstructor; | ||
| } | ||
|
|
||
| standUp(channel) { | ||
| console.log(`${this.name} announces to ${channel} @channel Standup Time!`); | ||
| } | ||
|
|
||
| debugsCode(student, subject) { | ||
| console.log(`${this.name} debugs ${student.name}'s code on ${student.favSubjects}`); | ||
| } | ||
| } | ||
|
|
||
| // Instructor objects | ||
|
|
||
| const dan = new Instructor({ | ||
| name: 'Dan', | ||
| age: 32, | ||
| location: 'Colorado', | ||
| specialty: 'Redux', | ||
| favLanguage: 'JavaScript', | ||
| catchPhrase: 'Rosie, no!', | ||
| }) | ||
|
|
||
|
|
||
| const josh = new Instructor({ | ||
| name: 'Josh', | ||
| age: 32, | ||
| location: 'Utah', | ||
| specialty: 'Redux', | ||
| favLanguage: 'JavaScript', | ||
| catchPhrase: 'Banjo time!', | ||
| }) | ||
|
|
||
|
|
||
| // Student objects | ||
|
|
||
| const emily = new Student({ | ||
| name: 'Emily', | ||
| age: 32, | ||
| location: 'Illinois', | ||
| previousBackground: 'Teacher', | ||
| className: 'Web 21', | ||
| favSubjects: 'Logic', | ||
| }) | ||
|
|
||
| const marcus = new Student({ | ||
| name: 'Marcus', | ||
| age: 32, | ||
| location: 'Illinois', | ||
| previousBackground: 'Teacher', | ||
| className: 'Web 21', | ||
| favSubjects: ['Logic', 'Syntax', 'Language'], | ||
| }) | ||
|
|
||
|
|
||
| // ProjectManager objects | ||
|
|
||
| const nick = new ProjectManager({ | ||
| name: 'Nick', | ||
| age: 32, | ||
| location: 'New Mexico', | ||
| specialty: 'Redux', | ||
| favLanguage: 'JavaScript', | ||
| catchPhrase: 'Listen up!', | ||
| gradClassName: 'Web 19', | ||
| favInstructor: 'Dan', | ||
| }) | ||
|
|
||
| const jose = new ProjectManager({ | ||
| name: 'Jose', | ||
| age: 32, | ||
| location: 'Illinois', | ||
| specialty: 'Redux', | ||
| favLanguage: 'JavaScript', | ||
| catchPhrase: 'Listen up!', | ||
| gradClassName: 'Web 19', | ||
| favInstructor: 'Dan', | ||
| }) | ||
|
|
||
|
|
||
| // console.log() tests | ||
|
|
||
| console.log(dan.name); | ||
| console.log(dan.catchPhrase); | ||
| console.log(emily.location); | ||
| console.log(marcus.listsSubjects()) | ||
| console.log(nick.catchPhrase); | ||
| console.log(nick.standUp("Nick_Ballenger's_Channel")); | ||
| console.log(nick.debugsCode(emily)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to keep confusion down you can actually use the same naming convention across all the super/constructors if you want to (you could go with attrs/props across the board if you wanted to)