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 19a864d commit 5eda434
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/java/CheckDigit.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ public static int getCheck(int num)
*/
public static boolean isValid(int numWithCheckDigit)
{
/* to be implemented in part (b) */
/* to be implemented in part (b) */
int w= getCheck(numWithCheckDigiit);
for (int i=0; i<getNumOfDigits:i++){
if (numWithCheckDigit==w)
return true;
else w/10;

}
return false;

}

/** Returns the number of digits in num. */
Expand Down

0 comments on commit 5eda434

Please sign in to comment.