#include #include using namespace std; const int MAX_CAP=10; /* Display an big integers stored as an array of decimal digits bigInt[0] is 1-th digit bigInt[1] is 10-th digit ... the number of digits is given by len */ void Display(int bigInt[], int len) { //todo by you. You need to display the most-significant digit first, and 1-th digit last } /* Add two large integers and store the result in res aDigits and aLen give the first integer, bDigits and bLen give the second integer sumDigits and sumLen will store the sum return true fi successful; false if fail (due to overflow) */ bool AddLargeInt (int aDigits[], int aLen, int bDigits[], int bLen, int sumDigits[], int & sumLen) { //Todo by you //1. Pad the two operands with leading 0's, i.e., add 0's to the end of // aDigits, bDigits array int carry=0; //2. adding the two large integers, below is the pseudocode // for i=0 to MAX_CAP-1 //start from 1-th digit, 10-th digit, ... // add the aDigits[i], bDigits[i] and carry up, and set to sum // set carry to 1 if the above sum is >=10 // set sum[i] to sum-carry //if carry!=0 // overflow, return false //otherwise // return true return true; //for now } /* Read large integers of up to MAX digits, store the digits in the array, and set the digit len return true if the input is valid, false if otherwise */ bool ReadLargeInt (int digits[], int & digit_len) { string input; int dig_value; cout <<"Enter large int (up to "<> input; //cout <<"You enter:"<100) { cout <<"The input is too long\n"; return false; } for (int i=0;i9 || dig_value<0) { cout <<"Invalid char " << input[digit_len-i-1]<< " in the input"<