diff --git a/index.js b/index.js index 989eb140..08031c75 100644 --- a/index.js +++ b/index.js @@ -1 +1,34 @@ -// Your code here \ No newline at end of file +class Cat { + constructor(name, sex){ + this.name = name, + this.sex = sex + } + speak() { + return `${this.name} says meow!` + } +} + +class Dog { + constructor(name, sex){ + this.name = name, + this.sex = sex + } + speak() { + return `${this.name} says woof!` + } +} + +class Bird { + constructor(name, sex){ + this.name = name, + this.sex = sex + } + + speak() { + if(this.sex === 'male') { + return `It's me! ${this.name}, the parrot!` + } else if (this.sex === 'female') { + return `${this.name} says squawk!` + } + } +}