Question: In Java, the int data type can only represent integers from - 2 , 1 4 7 , 4 8 3 , 6 4 8
In Java, the int data type can only represent integers from to This isnt big enough to store very large numbers. For example, to store the population of Earth approximately billion as of or to compute n for large values of nThe Java libraries contain a builtin class called BigInteger to handle arbitrarily large integers. In this problem, you will write your own class called BigInt that has a subset of the functionality of the builtin Java class.Representing integers using an array of digitsEach BigInt object will use an array of integers, where each element of the array represents a single digit of the integer.We will design the class to handle nonnegative integers with up to digits, and thus the array will always have a length of For example, the integer would be represented using this array:Note that:Each element of the array is a single digit ie an integer from The last element of the array ie the rightmost digit represents the least significant digit of the integer.The first nonzero element if there is one represents the most significant digit of the integer. The one exception is when we are representing itself. Its most significant digit is the same as its least significant digit, and it is a zero!The remaining elements are leading zeros that are not significant digits and should not be used in the computations.As another example, the integer for billion would be represented using the arrayTask : Download and review our starter codeBegin by downloading the following starter file: BigInt.javaOpen this file in your IDE and review its contents. We have given you:a class constant called MAXSIZE that represents the largest number of digits that a BigInt object can have. It will be used when constructing the array of digits.an instance member digits, which references an array of integers. The array referenced by digits represents the large integer.Note that the array referenced by digits must always be of length MAXSIZE.an instance member sigDigits, which stores the number of significant digits of the big integer. This is the same as the number of digits in the integer when it is written without leading zeroes. For example, for a BigInt that represents the integer sigDigits should be and for a BigInt that represents the integer sigDigits should be This internal member should be correct for all Big Integer objects, including the BigInt objects that are produced when computing the sum and the product.an instance member overflow that is turned on if an overflow occurs.a default constructor ie one that takes no arguments; it creates a BigInt object representing the number a set of tests in the body of a main method. At the moment, these tests are commented out, but you should gradually uncomment them and run them as you add functionality to the class.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
