Question: Use C++ to implement 1. School Method for Integer Addition 2. Must be Karatsuba Algorithm for Integer Multiplication 3. Integer Division all codes should contain

Use C++ to implement

1. School Method for Integer Addition

2. Must be Karatsuba Algorithm for Integer Multiplication

3. Integer Division

all codes should contain in one file

Three functions must be contained!!!!

TipsThis program takes one line as input. The input line contains three integers separated by spaces. Let

the three integers be I1, I2, and B. I1 and I2 are both nonnegative integers up to 100 digits long (there are

no leading 0s, except when the value itself is 0). B is I1 and I2s base (B is from 2 to 10).

Your program should output:

1. the sum of I1 and I2, using the school method,

2. the product of I1 and I2, using the Karatsuba algorithm

3. the ratio between I1 and I2 (rounded down).

You are asked to come up with a way to perform this division. I2 will not be 0.

The results should still use base B. Please separate the results using one space.

Sample input 1: 101 5 10

Sample output 1: 106 505 20

Sample input 2: 10 111 2

Sample output 2: 1001 1110 0

Sample input 3: 111 10 2

Sample output 2: 1001 1110 11

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!