diff --git a/app.js b/app.js index 29c0766..999f03a 100644 --- a/app.js +++ b/app.js @@ -66,4 +66,42 @@ teen.eat(); console.log(teen); //check that .eat() when isHungry == false works as expected -teen.eat(); \ No newline at end of file +teen.eat(); + + +class Vehicle { + constructor(model, color, gasPedal) { + this._model = model; + this._color = color; + this._gasPedal = gasPedal; + } + get model() { + return this._model; + } + get color() { + return this._color; + } + get gasPedal() { + return this._gasPedal; + } + accelerate() { + this._gasPedal++ + } +} + +class Audi extends Vehicle { + constructor(model, engineType) { + this._engineType = engineType; + } + engineType() { + return this._engineType; + } +} +class Ferrari extends Vehicle { + constructor(model, isSportCar) { + this.isSportCar = isSportCar; + } + isSportCar() { + return this._isSportCar; + } +}