28 lines
1.4 KiB
Plaintext
28 lines
1.4 KiB
Plaintext
# License: AGPLv3 or later. https://www.gnu.org/licenses/licenses.html
|
|
|
|
NOTE: will not compile if libgenVal.a and generateValue.h are missing
|
|
NOTE 2: general_function.h & general_function.cpp files are carried from previous assignments and additional functions related to this assignment added.
|
|
|
|
Compile on banshee as:
|
|
$ gmake
|
|
OR
|
|
$ gmake CFC
|
|
OR
|
|
$ CC -std=c++11 -o CFC *.cpp libgenVal.a
|
|
|
|
Assumptions and program behaviour
|
|
In:
|
|
int difference = Mint1 - Mint2;
|
|
both Mint have same modulus, otherwise, it would not make sense.
|
|
Plus In:
|
|
int difference = Melt2 - Melt2;
|
|
Both Mint and Melt, return an int even though usual expected return for operator-() is another object of same type. This is as per specification, Codeword expects an int return when calculating difference bewtween two objects of same type.
|
|
|
|
If user give number to Mint object higher than its modulus or less than 0 than Mint itself modulates it before storing in int number variable. So, number passed to Mint and returned by calling Mint.getNumber() function may not be same. NOTE: this is a hypothetical scenerio when someone else may use our written classes and functions as library. The program itself gives number which is within modulus range.
|
|
|
|
Error exit code list:
|
|
[For exact cause, see stderr]
|
|
1 - error related to arguments
|
|
2 - Program internal hypothetical errors which should never happen.
|
|
3 - Technically possible errors but which should not happen within the runtime of this program.
|