Skip to content
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

"completed mvp" #271

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 85 additions & 9 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,22 @@ class Airplane {
*/

class Person {

constructor(name, age){
this.name = name;
this.age = age;
this.stomach = [];
}
eat(edible){
if(this.stomach.length < 10){
this.stomach.push(edible);
}
}
poop(){
this.stomach = [];
}
toString(){
return `${this.name}, ${this.age}`;
}
}

/*
Expand All @@ -62,7 +77,26 @@ class Person {
*/

class Car {

constructor(model, mpg){
this.model = model;
this.milesPerGallon = mpg;
this.tank = 0;
this.odometer = 0;
}
fill(gallons){
this.tank = this.tank + gallons;
}
drive(dist){
const drivableMiles = this.tank * this.milesPerGallon;
if(dist <= drivableMiles){
this.odometer = this.odometer + dist;
this.tank = this.tank - (dist / this.milesPerGallon);
}else{
this.odometer = this.odometer + drivableMiles;
this.tank = 0;
return ` I ran out fo fuel at ${this.odometer} miles!`
}
}
}

/*
Expand All @@ -79,7 +113,14 @@ class Car {
*/

class Lambdasian {

constructor({name, age, location}){
this.name = name;
this.age = age;
this.location = location;
}
speak(){
return ` Hello my name is ${this.name}, I am from ${this.location}`;
}
}

/*
Expand All @@ -97,8 +138,19 @@ class Lambdasian {
+ `grade` receives a `student` object and a `subject` string as arguments and returns '{student.name} receives a perfect score on {subject}'
*/

class Instructor {

class Instructor extends Lambdasian{
constructor({name, age, location, specialty, favLanguage, catchPhrase}){
super({name, age, location, specialty, favLanguage, catchPhrase});
this.specialty = specialty;
this.favLanguage = favLanguage;
this.catchPhrase = catchPhrase;
}
demo(subject){
return `Today we are learning about ${subject}`;
}
grade(student, subject){
return `${student.name} receives a perfect score on ${subject}`;
}
}

/*
Expand All @@ -117,8 +169,22 @@ class Instructor {
+ `sprintChallenge` similar to PRAssignment but returns `student.name has begun sprint challenge on {subject}`
*/

class Student {

class Student extends Lambdasian{
constructor({name, age, location, previousBackground, className, favSubjects}){
super({name, age, location, previousBackground, className, favSubjects});
this.previousBackground = previousBackground;
this.className = className;
this.favSubjects = favSubjects;
}
listSubjects(){
return `Loving ${this.favSubjects}`;
}
PRAssignment(subject){
return `${this.name} has submitted a PR for ${subject}`;
}
sprintChallenge(subject){
return `${this.name} has begun sprint challenge on ${subject}`;
}
}

/*
Expand All @@ -135,8 +201,18 @@ class Student {
+ `debugsCode` a method that takes in a student object and a subject and returns `{name} debugs {student.name}'s code on {subject}`
*/

class ProjectManager {

class ProjectManager extends Instructor{
constructor({name, age, location, specialty, favLanguage, catchPhrase, gradClassName, favInstructor}){
super({name, age, location, specialty, favLanguage, catchPhrase, gradClassName, favInstructor});
this.gradClassName = gradClassName;
this.favInstructor = favInstructor;
}
standUp(channel){
return `${this.name} announces to ${channel}, @channel standy times!`;
}
debugsCode(student, subject){
return `${this.name} debugs ${student.name}'s code on ${subject}`;
}
}

/*
Expand Down
Loading