$Include "Rapidq.inc"
declare sub compute (sender as Qbutton)
declare sub exit (sender as Qbutton)
Create MainForm as QForm
Caption = "Dann Clark's Quarterback Rating Calculator"
Top = 150
Left = 200
Width = 480
Height = 300
BorderStyle = bsDialog
End Create
Create MainPanel as QPanel
Parent = MainForm
Caption = " "
Top = 0
Left = 0
Width = 480
Height = 300
End Create
Create CompletionsLabel as QLabel
Parent = MainPanel
Top = 40
Left = 20
Width = 50
Height = 13
Caption = "Completions"
End Create
Create AttemptsLabel as QLabel
Parent = MainPanel
Top = 40
Left = 100
Width = 50
Height = 13
Caption = "Attempts"
End Create
Create YardsLabel as QLabel
Parent = MainPanel
Top = 40
Left = 180
Width = 50
Height = 13
Caption = "Yards"
End Create
Create TDSLabel as QLabel
Parent = MainPanel
Top = 40
Left = 260
Width = 50
Height = 13
Caption = "Touchdowns"
End Create
Create IntsLabel as QLabel
Parent = MainPanel
Top = 40
Left = 340
Width = 50
Height = 13
Caption = "Interceptions"
End Create
Create CompletionsEdit as QEdit
Parent = MainPanel
taborder=1
Top = 60
Left = 20
Width = 50
Height = 21
Text = ""
End Create
Create AttemptsEdit as QEdit
Parent = MainPanel
taborder=2
Top = 60
Left = 100
Width = 50
Height = 21
Text = ""
End Create
Create YardsEdit as QEdit
Parent = MainPanel
taborder=3
Top = 60
Left = 180
Width = 50
Height = 21
Text = ""
End Create
Create TouchdownsEdit as QEdit
Parent = MainPanel
taborder=4
Top = 60
Left = 260
Width = 50
Height = 21
Text = ""
End Create
Create IntsEdit as QEdit
Parent = MainPanel
taborder=5
Top = 60
Left = 340
Width = 50
Height = 21
Text = ""
End Create
Create ComputeButton as QButton
Parent = MainPanel
taborder=6
Top = 160
Left = 125
Width = 50
Height = 21
Caption = "Compute"
Onclick = compute
End Create
Create ExitButton as QButton
Parent = MainPanel
taborder=8
Top = 160
Left = 250
Width = 50
Height = 21
Caption = "Exit"
Onclick = Exit
End Create
Sub compute (sender as Qbutton)
completions=val(Completionsedit.text)
attempts=val(attemptsedit.text)
yards=val(yardsedit.text)
touchdowns=val(touchdownsedit.text)
interceptions=val(intsedit.text)
f1a = (completions/attempts)*100
f1b=f1a-30
f1=f1b*0.05
if f1<=0 then f1=0
if f1>2.375 then f1=2.375
f2a=(yards/attempts)
f2b=f2a-3
f2=f2b*.25
if f2<=0 then f2=0
if f2>2.375 then f2=2.375
f3a=(touchdowns/attempts)*100
f3=f3a*.2
if f3<=0 then f3=0
if f3>2.375 then f3=2.375
f4a=(interceptions/attempts)*100
f4b=f4a*.25
f4=2.375-f4b
if f4<=0 then f4=0
if f4>2.375 then f4=2.375
rating1 = (f1+f2+f3+f4)/6
rating2=int((rating1*10000)+.5)
rating=rating2/100
ratingd$="Quarterback rating is : "+str$(rating)
messagebox (ratingd$,Rating,1)
end sub
sub exit (sender as QButton)
end
end sub
MainForm.ShowModal