Topic: Huge Integer
Create a Class CHugeInteger that uses a string to represent large integers. The class should be able to store any positive and negative numbers containing any number of characters. Assume the integer is positive unless the first character is ‘-‘. The following class definition or any equivalent is required. Your HugeInteger will be tested by calling all of the public functions shown. Feel free to add functions and/or additional functionality.
Provide a default constructor that initializes the value to 0.
Provide constructors to accept a string, long, or anotherCHugeInteger, as a parameter. The HugeInteger should initialize its own value to this parameter.
The Get function should allow the user to input a value, validate that the value entered is numeric, and truncate any decimal positions. If the value entered is not numeric set m_Value to “0”. I realize that we could derive a method of picking a number out of the string but I want to keep this as simple as possible.
The Display function simply presents the value on the screen. If you want to complicate the function, include commas after every third number (reading from right to left).
The Set functions should assign the value of their parameters to m_Value.
The Subtract functions should subtract the value of the parameter from m_Value.
The Add functions should add the value of the parameter to m_Value.
The IsEqual functions should return true if parameter is the same value as m_Value. It should return false otherwise.
The private IsNumeric function should return true if m_Value accurately represents an integer as describe above. It should return false otherwise. This function should be used from the public method Get.
You are responsible for providing a test program named Assignment2.cpp. Your test program should test every function in the class definition. I will also use a test program of my own on your class.
To use the string datatype use the following includes and using declarations.
For an example on how to use the string data-type see:
For an example of how to convert a long to a string see:
For an example of how to convert all of a string to a long, or part of a string to a long see: