Microsoft Small Basic

Program Listing: KFW618
TextWindow.WriteLine(Clock.Time)
TextWindow.WriteLine("")
TextWindow.Title = "Calculator!"

TextWindow.WriteLine("This program Adds, Subtracts, Multiplies and Divides.")
TextWindow.WriteLine("")
Start:
Start1:

TextWindow.Write("Enter a Number: ")
N = TextWindow.ReadNumber()
TextWindow.WriteLine("")

TextWindow.Write("Enter a Sign (+ - * /): ")
AD = TextWindow.Read()
TextWindow.WriteLine("")

TextWindow.Write("Second Number: ")
D = TextWindow.ReadNumber()
TextWindow.WriteLine("")

If AD = "+" Then
N1 = N+D
TextWindow.WriteLine(N1)
ElseIf AD = "-" Then
N2 = N-D
TextWindow.WriteLine(N2)
Elseif AD = "*" Then
N3 = N*D
TextWindow.WriteLine(N3)
Elseif AD = "/" Then
If D = 0 Then
TextWindow.WriteLine("Wrong")
TextWindow.WriteLine("")
Goto Start1
EndIf
N4 = N/D
TextWindow.WriteLine(N4)
Else
TextWindow.WriteLine("Wrong")
TextWindow.WriteLine("")
EndIf

TextWindow.WriteLine("")
Goto Start