forked from shalevf6/AP-scriptRunner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntVariable.h
More file actions
29 lines (24 loc) · 755 Bytes
/
IntVariable.h
File metadata and controls
29 lines (24 loc) · 755 Bytes
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
27
28
29
/*/
* A class that represents a variable of type int
*/
#ifndef ASS_4_INTVARIABLE_H
#define ASS_4_INTVARIABLE_H
#include <iostream>
using namespace std;
#include "Variable.h"
class IntVariable : public Variable {
private:
int m_intValue;
ostream & Show(ostream & out)const;
public:
IntVariable(int newVal, string name, string type="int");
~IntVariable();
int getVal()const;
void setVal(int newVal);
IntVariable& operator+(const IntVariable& addTo);
IntVariable& operator+=(const IntVariable& addToPlusOne);
IntVariable& operator=(const IntVariable& newVal);
bool operator==(const IntVariable& equalTo)const;
friend ostream & operator<<(ostream& out,const IntVariable& i);
};
#endif //ASS_4_INTVARIABLE_H