Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / main.cpp
diff options
context:
space:
mode:
Commit29b40528c6b7fc5ac56acc6dc6054b5270349c73 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-19 21:17:07 +0300
Committer
 GitHub <noreply@github.com>
2019-09-19 21:17:07 +0300
Files06ab88fb02831133565ef7f729fb34327a5297d1 /Polymorphism/main.cpp
Object-oriented_programming_FMI-29b40528c6b7fc5ac56acc6dc6054b5270349c73.tar
Object-oriented_programming_FMI-29b40528c6b7fc5ac56acc6dc6054b5270349c73.tar.gz
Object-oriented_programming_FMI-29b40528c6b7fc5ac56acc6dc6054b5270349c73.zip
Parent23b831108ae8cf6130e0e8a007aa56436c860b6a (diff)
Add files via upload
1 files changed, 20 insertions, 0 deletions
-rw-r--r--Polymorphism/main.cpp20
diff --git a/Polymorphism/main.cpp b/Polymorphism/main.cpp
new file mode 100644
index 0000000..39336c3
--- /dev/null
+++ b/Polymorphism/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;
+ }
+
+
+}
+
+