Question: JAVA Part 2: convertStringToBigInt (5 points) Do not use charAt in this problem, use substring! Complete this method in BigIntAddition.java void convertStringToBigInt(String strValue, int[] number)

JAVA

Part 2: convertStringToBigInt (5 points)

Do not use charAt in this problem, use substring!

Complete this method in BigIntAddition.java

void convertStringToBigInt(String strValue, int[] number) {

number is initialized with zeros, and always large enough to hold the answer

You do not have to create number in your code!

Convert a String representation of a number into an array representation of a number.

String "54321"

index

0

1

2

3

4

"5"

"4"

"3"

"2"

"1"

array

index

0

1

2

3

4

value

1

2

3

4

5

Note how the values are located at opposite indices.

Use Integer.parseInt to convert individual numbers in the string into digits. You used Integer.parseInt in FracCalc if you need to remember how to use it.

TO START USE THIS METHOD:

/**

* Converts the strValue passed in into an array representation of a number in

* the format used by addBigInts

* @param strValue - string value to be converted

* @param number - passed in filled with zeros and is large enough to hold the number

* When this methos is complete, number holds the converted value.

*/

public static void convertStringToBigInt(String strValue, int [] number) {

// Use Integer.parseInt(String) to convert a string number into a decimal number

}

thank you!

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!