Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions