Description
Create a class HugeInteger that uses a 40-element array of digits to store integers as large as 40 digits each. Provide member functions add and subtract. For comparing HugeInteger objects A and B, provide another member function isGreaterThan that returns true if A > B and returns false otherwise.
Note:
1. This problem involves three files.
l function.h: Class definition of HugeInteger.
l function.cpp: Member-function definitions of HugeInteger.
l main.cpp: A driver program to test your class implementation.
You will be provided with function.h and main.cpp, and asked to implement function.cpp.
function.h
main.cpp
2. For OJ submission:
Step 1. Include function.h into function.cpp and then implement your function.cpp. (You don’t need to modify function.h and main.cpp)
Step 2. Submit the code of function.cpp into submission block.
Step 3. Check the results and debug your program if necessary.
Input
There are three strings in each line: S1 S2 S3
S1 represents an operator (+,-,>).
S2 and S3 represent the two positive huge-number operands.
For subtract operation, S2 is always no less than S3.
Input terminated by EOF.
Output
For every given operation, your program should print the corresponding result followed by a new line character.
For every + and - operation, there will have two same answer to check your class which is implemented perfectly.
Partial Judge Code
10529.cpp
Partial Judge Header
10529.h
Tags