Tuesday, March 3rd at 11:59pm

Overload four operators for your `BigInt`

class: ++ (both
pre and post), <, and ==.

In addition to meeting the requirements from the previous
assignments, your `BigInt`

class should also have the
following overloaded operators:

- The ++ pre-increment operator should increment the value of the
`BigInt`

by one. The operator should evaluate to the new, incremented`BigInt`

. For example:BigInt b1( "1" ); (++b1).print(); // should display '2' b1.print(); // should display '2'

If incrementing the`BigInt`

would result in an overflow (i.e. a number greater than 20 digits), the`BigInt`

should be set to zero. - The ++ post-increment operator should also increment the value of
the
`BigInt`

by one. However, the post-increment operator**should evaluate to the original, un-incremented**. For example:`BigInt`

BigInt b1( "1" ); (b1++).print(); // should display '1' b1.print(); // should display '2'

As before, if incrementing the`BigInt`

would result in an overflow (i.e. a number greater than 20 digits), the`BigInt`

should be set to zero. - The less-than comparison operator < should be implemented as a
global friend function of the
`BigInt`

class. This function should take two`BigInt`

arguments -- the left and right-hand side of the operator -- and should return true if the left`BigInt`

is less than the right one. For example:BigInt b1( "314159" ); BigInt b2( "1" ); cout << (b1 < b2) << '\n'; // should display 0 cout << (b2 < b1) << '\n'; // should display 1

- The equal-to comparison operator == should be implemented as a
global friend function of the
`BigInt`

class. This function should take two`BigInt`

arguments -- the left and right-hand side of the operator -- and should return true if the two`BigInt`

objects are equal. For example:BigInt b1( "314159" ); BigInt b2( "1" ); cout << (b1 == b2) << '\n'; // should display 0 BigInt b3( "42" ); BigInt b4( "42" ); cout << (b3 == b4) << '\n'; // should display 1

As usual, you should be able to compile your code using the Makefile from the last assignment by typing:

make

If all goes well, you shouldn't see any error messages. Then you can run your code by typing:

./main

Whatever you've included in your `main`

function should
run, and any output that is generated should appear on your
screen.

When you're happy with your code, use the
turnin program to submit your `BigInt.cc`

and
`BigInt.h`

files. Use `assignment5`

as the
assignment name.

`BigInt.cc`

`BigInt.h`

When you just can't get enough, there's...

- Implement some more comparison operators. If you're clever, these
will be
*really*easy (remember DRY!):`<=, >=, >, !=`

- Overload the array-access operator so that users can access and
modify individual digits of your
`BigInt`

. For example:BigInt b1( "314159" ); cout << b1[0] << '\n'; // should display 3 cout << b1[1] << '\n'; // should display 1 cout << b1[2] << '\n'; // should display 4 b1[0] = 1; b1.print(); // should display 114159