CS177/457 C++ Programming
Spring 1998
An abstract data type for large integers
Introduction
Your task is to write a class for very large integers, i.e. ones that do not have a size limitation, and can be any number of digits long. Your program will consist of a single class, and a main function that tests its capabilities.
Requirements
Your class must:
Hints and notes
Testing
Your program should be able to succesfully compile and execute the following
main function (assuming the name of the class is Bignum):int main() { Bignum t1, t2(111), t3("1234567890"); // three different constructors Bignum t4 = t2; // default copy constructor cout << "t1 is " << t1 << endl; cout << "t2 is " << t2 << endl; cout << "t3 is " << t3 << endl; cout << "t4 is " << t4 << endl; t1 = t4 * t3 + t3 * t2; // arithmetic operators, and assignment cout << "t1 is " << t1 << endl; if (t1 < t2) // comparison cout << "t1 is less than t2" << endl; else cout << "t1 is not less than t2" << endl; if (t4 == t2) // equality cout << "t4 equals t2" << endl; else cout << "t4 does not equal t2" << endl; }
Due date
Hand in a print of your completed source code file, with output of running with the above main function, by 5pm on Friday 27th. March.