Website Summary Files Commits Branches @commit @diff @stats
path: root / Polymorphism / MathExpression / Num.hpp
blob: 91e1492df86269de0c92cdfa4a8bda87262f3902 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#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;
	}
	int getNum()
	{
		return number;
	}

};