From 96b36132fdb276eae3742c5f316487dada35d529 Mon Sep 17 00:00:00 2001 From: asmaquraishi Date: Tue, 5 Feb 2019 15:31:40 +0300 Subject: [PATCH] homework done I did the first part only! I couldn't solve the others, difficulties in understanding the problem! --- .DS_Store | Bin 0 -> 6148 bytes geom.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..b79a2fbe0b1f0c7630366d9d97b61a9aff43917b GIT binary patch literal 6148 zcmeHK%T5A85Uj>Ef?has+@mKF|6oJV#H)S)@`{fvf+C5>{R}_Kf5PhS3E2&JHHLJP zo|;Ej&uk6Z*#RJf&Fl*30%+3}TOAe$Ovlyttd)9BiDEhWc)|L%TuvwDUUYQ)M+J26 z&hUsimRO*+f6EC+^lx!PzucO!2Aty=ub7eX$@nLHkXQPi?>OJeq04rw6!fsd1|@$Z zyp#FH)*NecNAx)}tT;BddY`RXGoRcsM|}+)%QEIF7Gxh_*s8y3tIjyvim}sXX6Q=m zak|>DP#_ct1&&<-p4n>c3&$u!flwe6*eRgzhn%ihB&;0m)xpB90K|;lW~}Q+qjK_u zMZ(IFBQ$X;(W#QI7~*vH=P9m8SUEZ!k}e;TW|nkA5u2U)a|?$Qj!}jJp+HlC6K{6) z{J;MF{@)};D-;L?j!FT^hWEn(A1R%!dk?2)ZBBont7%;2xTCOQM=@jdDDKhC*q>{K VSR||**+YvD0h1w$P~cA$_yJ3KQLF#} literal 0 HcmV?d00001 diff --git a/geom.js b/geom.js index d942747..d59f2da 100644 --- a/geom.js +++ b/geom.js @@ -3,7 +3,40 @@ class Rectangle { this.length = length; this.width = width; } + + isSquare(){ +this.length = this.length; +this.width = this.width; +if(this.length === this.width){ + return true; +}else{ + return false; +} + } +area(){ + +this.length = this.length; +this.width = this.width; + return this.length * this.width; +} +perimeter(){ +this.length = this.length; +this.width = this.width; + return (2 * this.length ) + (2 * this.width ); } +} + +////// console + +/*const test = new Rectangle (4, 5); + +test.area() +20 +test.perimeter() +18 +test.isSquare() +false +*/ class Triangle {