Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / Figures / main.cpp
diff options
context:
space:
mode:
Commit1642c3257456591480c6179e5d4d377741ede6c8 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-19 21:19:44 +0300
Committer
 GitHub <noreply@github.com>
2019-09-19 21:19:44 +0300
Files61bab04611d3abb55a7a9178e0914b0be3a8d6a0 /Polymorphism/Figures/main.cpp
Object-oriented_programming_FMI-1642c3257456591480c6179e5d4d377741ede6c8.tar
Object-oriented_programming_FMI-1642c3257456591480c6179e5d4d377741ede6c8.tar.gz
Object-oriented_programming_FMI-1642c3257456591480c6179e5d4d377741ede6c8.zip
Parent730189c846b762c42fba955ca6a01d3a2fbf7acf (diff)
Rename Polymorphism/main.cpp to Polymorphism/Figures/main.cpp
1 files changed, 20 insertions, 0 deletions
-rw-r--r--Polymorphism/Figures/main.cpp20
diff --git a/Polymorphism/Figures/main.cpp b/Polymorphism/Figures/main.cpp
new file mode 100644
index 0000000..39336c3
--- /dev/null
+++ b/Polymorphism/Figures/main.cpp
@@ -0,0 +1,20 @@
+#include "Figure.h"
+
+
+int main()
+{
+ Figure** arr= new Figure*[3];
+ arr[0] = new Triangle(15, 15, 15, 30, 50, 30);
+ arr[1] = new Rectangle(15, 15, 50, 30);
+ arr[2] = new Circle(1, 2, 9);
+
+ for (int i = 0; i < 3; i++)
+ {
+ cout << arr[i]->getPer()<<endl;
+ cout << arr[i]->getArea()<<endl;
+ }
+
+
+}
+
+