13: bigNumber.cpp) Write functions for doing arithmetic on 100-digit integers. Include functions for input, output, and addition. The input function should not print anything. The addition function should do no reading or printing. No function should make any assumptions about how the other functions or main program work. The number of digits should be in a global constant. The function prototypes should be as follows: void readBig (int []) void addBig (int [], int [], int []) void printBig (int []) Use the main program provided to test the functions.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter15: Recursion
Section: Chapter Questions
Problem 12PE
icon
Related questions
Question

Please code using C++ and only use the header <iostream>. The use of any additional headers will not be accepted. Thank you!

13: bigNumber.cpp) Write functions for doing arithmetic
on 100-digit integers. Include functions for input, output,
and addition. The input function should not print anything.
The addition function should do no reading or printing. No
function should make any assumptions about how the other
functions or main program work. The number of digits
should be in a global constant. The function prototypes
should be as follows:
void readBig(int [])
void addBig (int [], int [], int[])
void printBig (int [])
Use the main program provided to test the functions.
Transcribed Image Text:13: bigNumber.cpp) Write functions for doing arithmetic on 100-digit integers. Include functions for input, output, and addition. The input function should not print anything. The addition function should do no reading or printing. No function should make any assumptions about how the other functions or main program work. The number of digits should be in a global constant. The function prototypes should be as follows: void readBig(int []) void addBig (int [], int [], int[]) void printBig (int []) Use the main program provided to test the functions.
#include <iostream>
using namespace std:
//This program will test three functions capable of reading, adding,
/and printing 100-digit numbers.
// Do not change these function prototypes:
void readBig(int[]):
void printBig(int[]):
void addBig(int[], int[], int[]):
// This constant should be 100 when the program is finished.
const int MAX_DIGITS = 100;
/There should be no changes made to the main program when you turn it in.
int main()
{
// Declare the three numbers, the first, second and the sum:
int numl[MAX_DIGITS], num2[MAX_DIGITS], sum[MAX_DIGITS]:
bool done = false;
char response;
while (not done)
cout << "Please enter a number up to "<<MAX_DIGITS<<" digits: ";
readBig(num1);
cout << "Please enter a number up to "<<MAX_DIGITS<<" digits: ";
readBig(num2);
addBig(num1, num2, sum);
printBig(num1);
cout << "n+\n";
printBig(num2):
cout << "\n=\n";
printBig(sum):
cout << "\n";
cout <<"test again?";
cin>>response;
cin.ignore(900,"\n'):
done = toupper(response)!='Y';
}
return 0;
}
Transcribed Image Text:#include <iostream> using namespace std: //This program will test three functions capable of reading, adding, /and printing 100-digit numbers. // Do not change these function prototypes: void readBig(int[]): void printBig(int[]): void addBig(int[], int[], int[]): // This constant should be 100 when the program is finished. const int MAX_DIGITS = 100; /There should be no changes made to the main program when you turn it in. int main() { // Declare the three numbers, the first, second and the sum: int numl[MAX_DIGITS], num2[MAX_DIGITS], sum[MAX_DIGITS]: bool done = false; char response; while (not done) cout << "Please enter a number up to "<<MAX_DIGITS<<" digits: "; readBig(num1); cout << "Please enter a number up to "<<MAX_DIGITS<<" digits: "; readBig(num2); addBig(num1, num2, sum); printBig(num1); cout << "n+\n"; printBig(num2): cout << "\n=\n"; printBig(sum): cout << "\n"; cout <<"test again?"; cin>>response; cin.ignore(900,"\n'): done = toupper(response)!='Y'; } return 0; }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Introduction to Coding
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr