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"
| array
|
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started