Public Class Form5
Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
For i As Integer = 1 To 9
For j As Integer = 1 To 9
Dim num1 As Integer = i
Dim num2 As Integer = j
Dim sum As Integer = num1 + num2
Dim hexNum1 As String = Hex(num1).ToUpper()
Dim hexNum2 As String = Hex(num2).ToUpper()
Dim hexSum As String = Hex(sum).ToUpper()
TextBox1.AppendText(hexNum1 & "+" & hexNum2 & "=" & hexSum & vbCrLf)
Next
Next
End Sub
Private Sub Button2_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button2.Click
For i As Integer = 0 To 9
For j As Integer = 0 To 9
For k As Integer = 0 To 9
Dim num1 As Integer = i
Dim num2 As Integer = j
Dim sum As Integer = num1 + num2
Dim hexNum1 As String = i.ToString("X")
Dim hexNum2 As String = j.ToString("X")
Dim hexSum As String = sum.ToString("X")
TextBox1.AppendText(hexNum1 & "+" & hexNum2 & "=" & hexSum & vbCrLf)
Next
Next
Next
End Sub
Private Sub Button3_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button3.Click
Dim digits As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
For i As Integer = 1 To 61
For j As Integer = 1 To 61
Dim num1 As Integer = i - 1
Dim num2 As Integer = j - 1
Dim sum As Integer = num1 + num2
Dim base62Num1 As String = ConvertToBase62(num1, digits)
Dim base62Num2 As String = ConvertToBase62(num2, digits)
Dim base62Sum As String = ConvertToBase62(sum, digits)
TextBox1.AppendText(base62Num1 & "+" & base62Num2 & "=" & base62Sum & vbCrLf)
Next
Next
End Sub
Private Function ConvertToBase62(ByVal number As Integer, ByVal digits As String) As String
Dim base62 As String = ""
Do
Dim remainder As Integer = number Mod 62
base62 = digits(remainder) & base62
number = number \ 62
Loop While number > 0
Return base62
End Function
Private Sub Button4_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button4.Click
Dim digits As String = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!@#$%^&*()-=_[]{}\\|;':\"
For i As Integer = 1 To 74
For j As Integer = 1 To 74
Dim num1 As Integer = i
Dim num2 As Integer = j
Dim sum As Integer = num1 + num2
Dim base75Num1 As String = ConvertToBase75(num1, digits)
Dim base75Num2 As String = ConvertToBase75(num2, digits)
Dim base75Sum As String = ConvertToBase75(sum, digits)
TextBox1.AppendText(base75Num1 & "+" & base75Num2 & "=" & base75Sum & vbCrLf)
Next
Next
End Sub
Private Function ConvertToBase75(ByVal number As Integer, ByVal digits As String) As String
Dim base75 As String = ""
Do
Dim remainder As Integer = number Mod 75
base75 = digits(remainder) & base75
number = number \ 75
Loop While number > 0
Return base75
End Function
End Class