Lab Test 4

 

Recall that the HugeInteger class in Assignment 4 contains an integer sign and an integer array to store 30 digits. Write the class definition with the following member functions:

1.         A constructor with no argument that initializes the newly created HugeInteger to 0.

2.         A member function set(char *p) that set the value of the HugeInteger to the value represented by the string p. In other words, x.set ("6543210987654321"); set x to 6543210987654321

3.         A member function output that prints out the value of the HugeInteger on the screen

4.         A member function bool lessthan(const HugeInteger &y) that returns true if the HugeInteger is less than y. Otherwise, the function returns false.

5.         A member function multiply(const HugeInteger &y, HugeInteger &z). x.multiply(y, z) computes z = x * y.

 

Write your own main program to test the above five member functions.