Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / MathExpression / Num.hpp
diff options
context:
space:
mode:
Commitd2422da2c1b2fcf75a3212eb36e94a718a39c0a5 (patch)
Author
 Angeld55 <achi_d@abv.bg>
2019-09-20 16:02:36 +0300
Committer
 GitHub <noreply@github.com>
2019-09-20 16:02:36 +0300
Files153acaf6a9084a50972b7542d737290219f72cf3 /Polymorphism/MathExpression/Num.hpp
Object-oriented_programming_FMI-d2422da2c1b2fcf75a3212eb36e94a718a39c0a5.tar
Object-oriented_programming_FMI-d2422da2c1b2fcf75a3212eb36e94a718a39c0a5.tar.gz
Object-oriented_programming_FMI-d2422da2c1b2fcf75a3212eb36e94a718a39c0a5.zip
Parent5e5abf297fcac67a3eb59db0a520eb6e63ffa531 (diff)
Add files via upload
1 files changed, 21 insertions, 0 deletions
-rw-r--r--Polymorphism/MathExpression/Num.hpp21
diff --git a/Polymorphism/MathExpression/Num.hpp b/Polymorphism/MathExpression/Num.hpp
new file mode 100644
index 0000000..d2da4ae
--- /dev/null
+++ b/Polymorphism/MathExpression/Num.hpp
@@ -0,0 +1,21 @@
+#include "Expression.hpp"
+class Num : public Expression
+{
+ int number;
+public:
+ Num(int number)
+ {
+ this->number = number;
+ type = 1;
+ }
+ void Print()
+ {
+ std::cout << number;
+ }
+ int Evaluate()
+ {
+ return number;
+ }
+
+
+}; \ No newline at end of file