subject

Adding BIG Integers In C++ an int is in the range 0 to 65535. But what if we need to add larger integers?Say we want compute the sum 2345566777844567+ 9999988777765768009998.You task in this assignment is to make this happen. Write a function string add(string a, string b)where a and b are strings representing integers and the function add(a, b) returns a string representing their sum. Strings a and b can have a maximum of 100 characters. Write a main program that loops asking the user for the two numbers a and b. The program should terminate if the user enters "done" what asked for "number" a. Code given by professor to start assigment:string add( string a, string b ) {string answer = "answer to be calcuated\n";return answer;}int main() {string x, y;for ( ;; ) {cout << "Enter two numbers a and b as string: " << "\t";cin >> x >> y;if ( x == "done" || y == "done" ){cout << "normal termination of the program" << endl;exit(1);}cout << x << " + " << y << " = " << add( x, y ) << endl;}return 0;}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 23:30, bri2008
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
image
Computers and Technology, 23.06.2019 02:30, noah2o2o
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of file type of operating system used
Answers: 2
image
Computers and Technology, 23.06.2019 04:00, terrell31
Write a method that takes in an array of point2d objects, and then analyzes the dataset to find points that are close together. be sure to review the point2d api. in your method, if the distance between any pair of points is less than 10, display the distance and the (x, y)s of each point. for example, "the distance between (3,5) and (8,9) is 6.40312." the complete api for the point2d adt may be viewed at ~pf/sedgewick-wayne/algs4/documenta tion/point2d. html (links to an external site.)links to an external site.. try to write your program directly from the api - do not review the adt's source code.
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, cireland
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits. now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order. finally, output thedigits in thearray. use at least two functions to organize your program.
Answers: 3
You know the right answer?
Adding BIG Integers In C++ an int is in the range 0 to 65535. But what if we need to add larger inte...

Questions in other subjects:

Konu
Mathematics, 12.08.2020 06:01