From 5dcd56c627b9afab4951700f982b027f64c1e848 Mon Sep 17 00:00:00 2001 From: Cayla Horsey Date: Mon, 3 Jun 2024 18:34:30 -0400 Subject: [PATCH] Pass all tests --- index.js | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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!` + } + } +}