Question: Define and implement a class HugeInteger that represents integers of 300 digits and a few simple operations on them, as indicated below. You will continue

Define and implement a class HugeInteger that represents integers of 300 digits and a few simple operations on them, as indicated below. You will continue to modify and otherwise develop this program in the future assignments. For now define a static constant hugeIntegerSize = 300. The integers are to be represented, in decimal notation, by a private data structure that consists of A byte array of decimal digits 0-9, of which the position of a digit equals to the corresponding power of 10. The integers sign Boolean operations for equality check as well as greaterThan and lessThan relatation. (Note that the comparison has to be performed digit-by-digit). Arithmetic operations Add, Subtract, and Mult. All operations have to be performed digit-by-digit, propagating the carry. In case of the overflow, you need to throw an exception. (Mult is the most complex operation, naturally, but at this point you dont have to do anything ingeniousprogram it in the most straight-forward way possible.) Start thinking about how you would implement the Integer division operation Divide. If you have time, implement it; otherwise, leave it for later. To this end, feel free to use any algorigthm that you can find on the Web, but make sure that you implement it yourself. i want these methods to include in the program for HugeIntegers but dont give me same solution without these methods so please carefully read the question and give me the solution for these methods as well.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!