Question: Programming Exercise 11 in Chapter 8 explains how to add large integers using arrays. However, in that exercise, the program could add only integers of,

Programming Exercise 11 in Chapter 8 explains how to add large integers using arrays.

However, in that exercise, the program could add only integers of, at most, 20 digits. This chapter explains how to work with dynamic integers.

*Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

*Add operations to add, subtract, multiply, and compare integers stored in two objects.

*Also add constructors to properly initialize objects and functions to set, retrieve, and print the values of objects.

Whats needed from any awesome person willing to help:

~ A class named largeIntegers that has functions that can perform what the above is asking for (MUST be able to handle numbers of any size)

~ Definitions of the functions of class largeIntegers

~ A main cpp file that will allow me to test everything.

For your reference, this is #11 of Chapter 8 (You do not need to do the problem below. It is just so that the above can perhaps make more sense)

This is what #11 says:

(Adding Large Integers) In C++, the largest int value is 2147483647 . So, an integer larger than this cannot be stored and processed as an integer. Similarly, if the sum or product of two positive integers is greater than 2147483647 , the result will be incorrect.

One way to store and manipulate large integers is to store each individual digit of the number in an array. Write a program that inputs two positive integers of, at most, 20 digits and outputs the sum of the numbers. If the sum of the numbers has more than 20 digits, output the sum with an appropriate message.

Your program must, at least,

* Contain a function to read and store a number into an array and another function to output the sum of the numbers.

(Hint: Read numbers as strings and store the digits of the number in the reverse order.)

Please and thank you so much!

Programming Exercise 11 in Chapter 8 explains how to add large integers

Thank you! . Thank you

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!