Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

need help finishing a code

Computer Science
I got my questions answered at in under 10 minutes. Go to now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly


Get your free account and access expert answers to this and thousands of other questions

#include #include 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 num1[MAX_DIGITS], num2[MAX_DIGITS], sum[MAX_DIGITS]; bool done = false; char response; while (!done) { cout << "Please enter a number up to "<>response; cin.ignore(900,'\n'); done = toupper(response)=='N'; } return 0; } void readBig(int x[]) { int length, i, oneLess, l; string number; getline(cin,number); length=number.length(); l=length-1; oneLess=MAX_DIGITS-1; for(i=0;i
need help finishing the addBig and printBig functions
If I understand your addBig() function, you are taking the number from the same index out of each array, adding them, then storing it in a third array. So you will have a for loop where you have array3[i] = array2[i] + array1[i]; and presumably you will do something with it there since you are neither passing by reference or returning a value.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

@eSpeX would i start it out like inti; for(i=0;i
Assuming MAX_DIGITS is the size of your array, yes. You want your index to step through each element of your array.
well this is what the code is supposed to do 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[])
I see where you are getting an integer from the user, what are you doing if that number isn't as big as 100 digits?
well my teacher wrote us the main function and told us not to change it, he wants us to add the three add, print, and read functions
Did your teacher also write the readBig() method or is that something you created?
i wrote the readBig function
The same loop you use for setting the values of the array is the same method you will use to step through the addition. You just have two arrays and a temp, so you will need to create a temp[] and then loop through saying that temp[i] = x[i] + y[i]; you will need to add some error handling in the event the two numbers go over 10 so you can carry it on to the next iteration.

Not the answer you are looking for?

Search for more explanations.

Ask your own question