Microsoft Small Basic

Program Listing: BWC453
TextWindow.Show()
start:
TextWindow.WriteLine("This program will create random problems for you to answer.")
TextWindow.Write("Please type an operation sign (+,-,/,*): ")
opcho = TextWindow.Read()
If opcho = "+" Then
an1 = Math.GetRandomNumber(99)
an2 = Math.GetRandomNumber(99)
TextWindow.Write(an1 + " + " + an2 + " = ")
adans = TextWindow.Read()
If adans = an1+an2 Then
TextWindow.WriteLine("Correct")
EndIf
If adans < an1 + an2 Then
TextWindow.WriteLine("Incorrect")
EndIf
If adans > an1 + an2 Then
TextWindow.WriteLine("Incorrect")
EndIf
EndIf
If opcho = "-" Then
s1 = Math.GetRandomNumber(99)
s2 = Math.GetRandomNumber(99)
TextWindow.Write(s1 + " - " + s2 + " = ")
sans = TextWindow.Read()
If sans = s1-s2 Then
TextWindow.WriteLine("Correct")
EndIf
If sans < s1 - s2 Then
TextWindow.WriteLine("Incorrect")
EndIf
If sans > s1 - s2 Then
TextWindow.WriteLine("Incorrect")
EndIf
EndIf
If opcho = "/" Then
select:
d1 = Math.GetRandomNumber(99)
d2 = Math.GetRandomNumber(99)
If Math.Remainder(d1, d2) > 0 Then
Goto select
Endif
If Math.Remainder(d1, d2) > 0 Then
Goto select
Endif
TextWindow.Write(d1 + " / " + d2 + " = ")
dans = TextWindow.Read()
If dans = d1/d2 Then
TextWindow.WriteLine("Correct")
EndIf
If dans < d1 / d2 Then
TextWindow.WriteLine("Incorrect")
EndIf
If dans > d1 / d2 Then
TextWindow.WriteLine("Incorrect")
EndIf
EndIf
If opcho = "*" Then
m1 = Math.GetRandomNumber(99)
m2 = Math.GetRandomNumber(99)
TextWindow.Write(m1 + " * " + m2 + " = ")
mans = TextWindow.Read()
If mans = m1*m2 Then
TextWindow.WriteLine("Correct")
EndIf
If mans < m1 * m2 Then
TextWindow.WriteLine("Incorrect")
EndIf
If mans > m1 * m2 Then
TextWindow.WriteLine("Incorrect")
EndIf
EndIf
TextWindow.Write("Would you like to answer another problem? Type Yes (1) or No (2): ")
restart = TextWindow.Read()
If restart = 1 Then
TextWindow.Clear()
Goto start
EndIf
If restart = 2 Then
Program.End()
EndIf