What you have shown us is the assignment, but there nothing specified as to what you want help with.
If the gist, as I am reading it, is confirm a check digit is correct, you will have to create a modulus value to check against the check digit.
Not knowing how much VB you know, it would be
worth looking at this[
^] to give you the function of a modulus.
Perform the maths funtion described in the assignment and compare it to the modulus of the operation and if they fail to match then run the exception code.
The other way is to perform the calculations of the hoof.
I wrote a similar function for verifying VAT numbers.
Example code for VAT checking.
<pre lang="vb">' declare variable
Dim strVatNumber As String
Dim arrVatNumber(8) As Integer
Dim intVatTotal As Integer
Dim intCheckSum As Integer
Dim strMessage
' set initial values
strVatNumber = TextBox1.Text
intVatTotal = 0
' loop to fill array from string and do the maths.
For i = 0 To 6
arrVatNumber(i) = Val(strVatNumber(i))
arrVatNumber(i) = arrVatNumber(i) * (8 - i)
intVatTotal = intVatTotal + arrVatNumber(i)
Next
' assign check sum
' assure that no multiply by zero
If arrVatNumber(7) <> 0 Then
arrVatNumber(7) = Val(strVatNumber(7))
arrVatNumber(8) = Val(strVatNumber(8))
intCheckSum = (arrVatNumber(7) * 10) + arrVatNumber(8)
Else
intCheckSum = arrVatNumber(8)
End If
While intVatTotal > 97
intVatTotal = intVatTotal - 97
End While
'give result
If intCheckSum = intVatTotal Then
strMessage = "Vat Number Confirmed OK"
Else
strMessage = "Vat Number -INCORRECT-"
End If
Label1.Text = strMessage
I assigned this to a button click event of a form.
Try either approach, good luck.