Question: IsValidMod10Number Function: This objective of this function is to take a 16 digit credit card number as a string parameter and create an integer array

 IsValidMod10Number Function: This objective of this function is to take a

IsValidMod10Number Function: This objective of this function is to take a 16 digit credit card number as a string parameter and create an integer array of each digit of extracted from the credit card number. Then, starting from the last digit of the number array, multiply alternate number by 2 based on a check bit. If the multiplied number is greater than 9, subtract 9 from it and re-set the digit. If the multiplied number is less than or equal to 9, new digit will be the multiplied value. Finally, add the digit to a final sum. Return value of the function is the totalSum mod 10. public static boolean IsValidMod10Number (String number) { int [] numberArray = new int[number.length()]; boolean checkBit = false; int sumTotal =0; for(int i=0; i = 0 ; index--) { if (checkBit) { numberArray[index] *=2; if (numberArray[index] > 9) { numberArray[index] -= 9; } } sumTotal += numberArray[index]; checkBit = !checkBit; } return sumTotal % 10 ==0; } (A) Develop the control flow graph for the above function

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!