1. Inputbox ID
Dim a As Double
Dim num1, num2, num3, num4, num5, num6, num7 As Double
Dim total As Double
Dim ans As Double
a = InputBox("enter a seventh number")
num1 = ((a \ 10 ^ 0) Mod 10) * 2
num2 = ((a \ 10 ^ 1) Mod 10) * 3
num3 = ((a \ 10 ^ 2) Mod 10) * 4
num4 = ((a \ 10 ^ 3) Mod 10) * 5
num5 = ((a \ 10 ^ 4) Mod 10) * 6
num6 = ((a \ 10 ^ 5) Mod 10) * 7
num7 = ((a \ 10 ^ 6) Mod 10) * 8
total = num1 + num2 + num3 + num4 + num5 + num6 + num7
ans = 11 - (total Mod 11)
Label2.Text = a
If ans = 11 Then
Label1.Text = 0
ElseIf ans = 10 Then
Label1.Text = "x"
Else
Label1.Text = ans
End If
2. textbox ID
Dim num1, num2, num3, num4, num5, num6, num7 As Integer
Dim total As Double
Dim ans As Double
num1 = TextBox1.Text * 8
num2 = TextBox2.Text * 7
num3 = TextBox3.Text * 6
num4 = TextBox4.Text * 5
num5 = TextBox5.Text * 4
num6 = TextBox6.Text * 3
num7 = TextBox7.Text * 2
total = num1 + num2 + num3 + num4 + num5 + num6 + num7
ans = 11 - (total Mod 11)
If ans = 11 Then
Label1.Text = 0
ElseIf ans = 10 Then
Label1.Text = "x"
Else
Label1.Text = ans
End If