In this set of exercises, you are to implement a class named Even_Num that represents even integers. The invariant/constraint/rule for this class is that no object is ever allowed to contain an odd value. You are to code the .h file and the .cpp file (two separate questions).
A usual set of functions/operators:
A constructor that accepts an integer (defaults to 0) and uses it to initialize the object
A << operator that simply prints out the value of the object
+ and += operators with the usual meaning for add and addInPlace
/ and /= operators with the usual meaning for divide and divideInPlace
a get function that returns the value of the object
The usual rules:
+= and /= should be members
+ and / should be non-member friends
The << operator should be a non-member friend
get should be a const member function
the usual parameter transmission conventions
And I've supplied the usual Even_Num_Exception class, contained in the file even_num_exception.h
Remember, you will be submitting one half of the module pair, and I the other, so you must match my signatures.
*In C++ Language
It's no signatures in the (.h file). bypass that. thanks