An array can be used to store large integers one digit at a time. For example, the

Question:

An array can be used to store large integers one digit at a time. For example, the integer 1234 could be stored in the array a by setting a[0ti]ngtox1x,xa[1] to 2, a[2] to 3, and a[3] to 4. However, for this project, you might find it easier to store the digits backward, that is, place 4 in a[0], place 3 in a[1], place 2 in a[2], and place 1 in a[3].

Design, implement, and test a class in which each object is a large integer with each digit stored in a separate element of an array. You’ll also need a private instance variable to keep track of the sign of the integer (perhaps a boolean variable). The number of digits may grow as the program runs, so the array may have to grow beyond its original size.

Discuss and implement other appropriate operators for this class (which is similar to Java’s own BigInteger class).

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: