Microsoft Small Basic

Program Listing: TXP745
'Practice for Code test 9/14/10
'Created by David Fountain

GraphicsWindow.Title = "Rocklin PD Code answers"
GraphicsWindow.Height = 445
GraphicsWindow.Width = 350

'GraphicsWindow.BrushColor = Colors.Green
GraphicsWindow.drawtext(25,25, "Possible Answers")
'GraphicsWindow.BrushColor = Colors.Black
GraphicsWindow.drawtext(25,40, "Burglary") '10-2
GraphicsWindow.drawtext(25,55, "Grand Theft") '10-6
GraphicsWindow.drawtext(25,70, "Petty theft") '10-10
GraphicsWindow.drawtext(25,85, "possession of stolen property") '10-1
GraphicsWindow.drawtext(25,100, "Vandalism") '10-7
GraphicsWindow.drawtext(25,115, "Trespassing") '10-8
GraphicsWindow.drawtext(25,130, "Graffiti") '10-4
GraphicsWindow.drawtext(25,145, "Drunk in public") '10-9
GraphicsWindow.drawtext(25,160, "Annoying or molesting a child") '10-2

GraphicsWindow.ShowMessage("Choose your Answer from this sheet only. Make sure you spell it correctly or it will be marked wrong.. Click 'Ok' to start your Practice. Good Luck!","Practice Test 9/14/10")

TextWindow.Title = "Rocklin PD Code Practice"
'If you Change the order of the following Codes and responses make sure they
'Stay with the Correct pairs.
'Exmaple if you change "Radio Reception is poor" to Response[5]
'Then "10-1" should be changed to Codes[5]
'Order dosent mattter as long as the numbers 1-8 are there

Response[1] = "Burglary"
Response[2] = "Grand Theft"
Response[3] = "Petty theft"
Response[4] = "possession of stolen property"
Response[5] = "Vandalism"
Response[6] = "Trespassing"
Response[7] = "Graffiti"
Response[8] = "Drunk in public"
Response[9] = "Annoying or molesting a child"

Codes[1] = "459"
Codes[2] = "487"
Codes[3] = "488"
Codes[4] = "496"
Codes[5] = "594"
Codes[6] = "602"
Codes[7] = "640"
Codes[8] = "647f"
Codes[9] = "647.6"

Start:
TextWindow.Clear()
'TextWindow.ForegroundColor = Colors.Green
TextWindow.WriteLine("Code Test Practice for 9/14/10")

TextWindow.WriteLine("For each Code Given Write the Correct Answer")

For i=1 To 9
Retry:
'TextWindow.ForegroundColor = Colors.Green 'For incorrect Answer Color Correction
TextWindow.Write(Codes[i])
TextWindow.Write(": ")
'TextWindow.ForegroundColor = Colors.White
answer = TextWindow.Read()

If Text.ConvertToLowerCase(answer) = Text.ConvertToLowerCase(Response[i]) Then
'extWindow.ForegroundColor = Colors.Green
TextWindow.WriteLine("Correct.")
Else
TextWindow.WriteLine("Incorrect. Try again")
Goto Retry
EndIf
EndFor

TextWindow.Write("Would you like to try again? ")
'extWindow.ForegroundColor = Colors.White
answer = TextWindow.Read()
If Text.ConvertToLowerCase(answer) = "yes" Then
Goto Start
Else
' TextWindow.ForegroundColor = Colors.Green
TextWindow.WriteLine("Good luck on tuesday")
' TextWindow.ForegroundColor = Colors.White
Program.End()
EndIf