Skip to content

Commit

Permalink
Update CheckDigit.java
Browse files Browse the repository at this point in the history
  • Loading branch information
mykinglebron authored Apr 30, 2024
1 parent ba3a3d4 commit b02faa6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/CheckDigit.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public static int getCheck(int num)
{
int sum=0;
for(int i=1; i<getNumberOfDigits(num); i++){
sum =sum + ((8-i) * getDigit(num, i));
sum =sum +( (8-i) * getDigit(num, i) );
}
return sum%10;
}
Expand All @@ -26,7 +26,7 @@ public static boolean isValid(int numWithCheckDigit)
int num= numWithCheckDigit / 10;
int newCheck =getCheck(num);
if(newCheck==check){
return true)}
return true;}
else{return false;}
}

Expand Down

0 comments on commit b02faa6

Please sign in to comment.