Question: In this homework, you will write a program that reads in two positive integers that are 2 0 or fewer digits in length and then
In this homework, you will write a program that reads in two positive integers that are
or fewer digits in length and then outputs the sum of the two big integers.
Use the following declaration in your program:
vector bigInt bigInt sumBigInt;
Your program will read the big integers as strings. After they are read into the
program, each character in the string is changed to a value of type int and stored in
the corresponding vector appropriately. Recall that in the elementary school paper
andpencil addition algorithm, we start adding the digits in the units place first and
then move towards the higher place value. So pay attention to how you will store the
digits in the vector.
Your program will perform the addition by implementing the usual paperandpencil
addition algorithm. The result of the addition is stored in an array of size and the
result is then written to the screen. If the result of the addition is an integer with more
than the maximum number of digits that is more than digits then your program
should issue a message saying that it has encountered "integer overflow". You should
be able to change the maximum length of the integers by changing only one globally
defined constant. Include a loop that allows the user to continue to do as many
additions of big integers as they prefer until they choose to quit. Use C programming with using "using namespace std Make the code simple and not too long. Put the functions underbelow or after the "int main"
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
