summaryrefslogtreecommitdiff
path: root/rectangle.cpp
diff options
context:
space:
mode:
authorBenjamin Chausse <benjamin@chausse.xyz>2023-01-13 19:37:56 -0500
committerBenjamin Chausse <benjamin@chausse.xyz>2023-01-13 19:37:56 -0500
commit6a20ac2049d7e9fbf827838259911bf0899f46d9 (patch)
tree4b96dfc05bbd03da1d80bd2369b339dac5041c10 /rectangle.cpp
parentbd3b390064aa8dee26845dc6fcc1b5d79773a167 (diff)
parent86fbed0811fc4ef36ffb66b3f774df61eb87c24b (diff)
Fix gitignore merge
Diffstat (limited to 'rectangle.cpp')
-rw-r--r--rectangle.cpp42
1 files changed, 42 insertions, 0 deletions
diff --git a/rectangle.cpp b/rectangle.cpp
new file mode 100644
index 0000000..a70bfe4
--- /dev/null
+++ b/rectangle.cpp
@@ -0,0 +1,42 @@
+#include "rectangle.h"
+
+Rectangle::Rectangle(int x, int y, int w, int h):Forme(x, y){
+ setLargeur(w);
+ setHauteur(h);
+};
+
+Rectangle::~Rectangle(){
+};
+
+int Rectangle::getLargeur(){
+ return largeur;
+};
+
+int Rectangle::getHauteur(){
+ return hauteur;
+};
+
+Coordonnee Rectangle::getAncrageForme(){
+ return getAncrage();
+};
+
+void Rectangle::setLargeur(int l){
+ largeur=l;
+};
+
+void Rectangle::setHauteur(int h){
+ hauteur=h;
+};
+
+double Rectangle::aire(){
+ return largeur*hauteur;
+};
+
+void Rectangle::afficher(ostream &s){
+ s << "Rectangle:(x=" << getAncrageForme().x
+ << ", y=" << getAncrageForme().y
+ << ", l=" << getLargeur()
+ << ", h=" << getHauteur()
+ << ", aire=" << aire()
+ << ")\n";
+};