Write a program to print the table of 5 in Small Basic.
Answers
Explanation:
start:
Textwindow.Clear()
textwindow.Write("Loading ...")
TextWindow.WriteLine(" ")
TextWindow.Write("Choose your Time Table!")
timetable = TextWindow.Read()
For i = 1 to 12
TextWindow.ForegroundColor = "red"
TextWindow.Write (i)
TextWindow.Write (" times ")
TextWindow.Write (timetable)
TextWindow.Write (" = ")
TextWindow.Write (timetable*i)
TextWindow.WriteLine(" ")
endfor
TextWindow.Write("Test (Y/N)?")
answer = TextWindow.Read()
If(answer = "y") then
Goto test
Else
endif
TextWindow.Write("New Time Table (Y/N)?")
new = TextWindow.Read()
If (new = "y") then
Goto start
Else
endif
test:
TextWindow.Clear()
score = 0
For i = 1 to 24
result = Math.GetRandomNumber(12)
TextWindow.Write(result)
TextWindow.Write(" times ")
TextWindow.Write(timetable)
TextWindow.Write(" = ?")
ans = TextWindow.Read()
If(ans = timetable*result) Then
textwindow.Write("Correct!")
score=score+1
TextWindow.Write(score)
TextWindow.Write(" Correct so far ")
TextWindow.WriteLine(" ")
endif
endfor
TextWindow.Write(score)
TextWindow.Write(" Correct Out Of 24")
TextWindow.WriteLine(" ")
TextWindow.Write("Test Again (Y/N)?")
testag = TextWindow.Read()
If(testag = "y") Then
Goto test
Else
EndIf
TextWindow.Write("Choose Another Timetable (Y/N)?")
another = TextWindow.Read()
If(another = "y") Then
Goto start
Else
EndIf
Answer:
http://smallbasic.com/program/?GGX880
Explanation:
please click on for answer
as app it is not allowing me to post answer