Skip to content

Commit

Permalink
Update CheckDigit.java
Browse files Browse the repository at this point in the history
  • Loading branch information
willy2day authored Apr 30, 2024
1 parent a9db8b1 commit 19a864d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/CheckDigit.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ public class CheckDigit
public static int getCheck(int num)
{
/* to be implemented in part (a) */
int sum=0;
for (int i; i<getNumOfDigits;i++)
sum+=(8-i)*getDigit(num,i);
return sum%10;
}

/** Returns true if numWithCheckDigit is valid, or false
Expand Down

0 comments on commit 19a864d

Please sign in to comment.