| | **Overview** | |
The range of values of an integer in the C++ language depends on the system. For example, some systems represent an integer with 2 bytes, while others represent an integer with 4 or more bytes. If an integer is represented by 2 bytes, then the range of values is -32768 to 32767 (one bit used for the sign). Your job will be to write a large integer class. This class will be able to perform basic arithmetic operations on integers up to 20 digits in length.
Design a class called LargeInt which represents an integer with up to 20 digits. The class should have the following members.
1. A default constructor.
2. A copy constructor.
3. A constructor that takes a std::string which will consist of 1 to 20 characters that are all digits. This string will represent a LargeInt value.
2. Overloaded arithmetic operators, +, -, and *. Notice that your operators must test for overflow. If overflow occurs, display a message to that effect then quit the program.
3. Overloaded stream operators << and >>. Notice operator << will display a LargeInt and operator >> will extract a LargeInt from the keyboard.
You may include other members in the class if you like. These are the minimum requirements for the class.
You must write a program to test your LargeInt class as follows.
1. When the program is run, the user must be presented with a menu as follows.
1. Test operator +.
2. Test operator -.
3. Test operator *.
For each of the operations, the user must be prompted to enter two LargeInts. The user will enter a string of digits (1 to 20) for each LargeInt. Your program must then display both LargeInts then the result of the operation. The menu must recycle after the operation is performed.
Your program must have the following features.
1. At least one class (LargeInt).
2. A menu to greet the user.
3. Use of the keyword const in two contexts.
1. Use const for a constant member of a class.
2. Use const in a parameter list for one of the parameters that is passed.
4. Use of a data structure (You may not use the STL for this).
5. Use of a friend.
6. Use of operators new and delete.
7. Use of a namespace that you write (namespace std does not count).
8. Program Style (Comments, pre/post conditions, whitespace, indentation).
**THE DEADLINE FOR THIS IS NOVEMBER 17TH 2003 5PM. U.S MOUNTAIN TIME.**
g++ compiler. the program must compile on a g++ compiler.