-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBigDecimalIntClass.h
51 lines (43 loc) · 1.45 KB
/
BigDecimalIntClass.h
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// FCAI – Object-Oriented Programming 1 – 2022 - Assignment 1
// Program Name: BigDecimalInt
// Last Modification Date: 13/10/2022
// Author1 and ID and Group: Basmala Mohamed Sayed Gad ID: 20210090 (a, b, c)
// Author2 and ID and Group: Aya Ali Hassan ID: 20210083 (d, e)
// Author3 and ID and Group: Mohamed Ashraf Fahim ID: 20210329 (f, i, j , k)
/*
description: In this problem we developed a new C++ type (class).
that can hold unlimited decimal integer values and performs arithmetic operations on them.
such as: +, -, <, and >.
*/
#ifndef BIGDECIMALINT_BIGDECIMALINTCLASS_H
#define BIGDECIMALINT_BIGDECIMALINTCLASS_H
#include <iostream>
#include <deque>
#include <regex>
using namespace std;
class BigDecimalInt{
private:
string number;
char signNumber;
bool checkValidInput(string input);
public:
bool operator < (const BigDecimalInt& anotherDec);
bool operator > (const BigDecimalInt& anotherDec);
bool operator == (const BigDecimalInt anotherDec);
BigDecimalInt& operator = (BigDecimalInt anotherDec);
BigDecimalInt operator + (BigDecimalInt number2);
BigDecimalInt operator - (BigDecimalInt anotherDec);
friend ostream &operator << (ostream &out, BigDecimalInt num);
int size();
int sign();
void setNumber(string num);
string getNumber(){
return number;
}
BigDecimalInt(){}
BigDecimalInt(string num)
{
setNumber(num);
}
};
#endif //BIGDECIMALINT_BIGDECIMALINTCLASS_H