Question: Chapter 12, Problem 4PE of the book: C++ Programming From Problem Analysis to Program Design does not have a solution posted for it and I
Chapter 12, Problem 4PE of the book: C++ Programming From Problem Analysis to Program Design does not have a solution posted for it and I really need help in solving this problem. Essentially C++ has a limit of 20 digits you can store and I need a class that can store a number with infinite number of digits and add/subtract/multiply them together. So for example: a 10 with 1,000 numbers behind it + 9 with 500 numbers behind it. Normally this would be impossible and I am unable to use the algorithms library and vectors for this problem.
The only way of doing this that I can think of is by using Strings or Arrays, but I'm having a difficult time trying to set this up, so any help with this would be great.

Problem Programming Exercise 11 in Chapter 8 explains how to add large integers using a 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 largelntegers 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, a print the values of objects. REFERENCE (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 orde
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
