📄 form1.frm
字号:
Begin VB.TextBox Text1
Height = 495
Index = 6
Left = 600
TabIndex = 10
Text = " "
Top = 5160
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 5
Left = 600
TabIndex = 9
Text = " "
Top = 4440
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 4
Left = 600
TabIndex = 8
Text = " "
Top = 3720
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 3
Left = 600
TabIndex = 7
Text = " "
Top = 3000
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 2
Left = 600
TabIndex = 6
Text = " "
Top = 2400
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 1
Left = 600
TabIndex = 5
Text = " "
Top = 1680
Width = 1900
End
Begin VB.TextBox Text1
Height = 495
Index = 0
Left = 600
TabIndex = 4
Top = 1080
Width = 1900
End
Begin VB.Label Label12
BeginProperty Font
Name = "微软雅黑"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 735
Left = 6600
TabIndex = 60
Top = 3840
Width = 1110
End
Begin VB.Label Label11
Caption = "加权平均分"
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6600
TabIndex = 59
Top = 3000
Width = 1335
End
Begin VB.Label Label10
Caption = "制作时间: 2009年2月21日"
ForeColor = &H00C00000&
Height = 375
Left = 6480
TabIndex = 58
Top = 8400
Width = 1695
End
Begin VB.Label Label9
Caption = "制作者:丁月文"
ForeColor = &H00800000&
Height = 375
Left = 6480
TabIndex = 57
Top = 7920
Width = 1335
End
Begin VB.Label Label8
Caption = "科目数"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6720
TabIndex = 56
Top = 6120
Width = 1095
End
Begin VB.Label Label7
BeginProperty Font
Name = "微软雅黑"
Size = 26.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H000000C0&
Height = 855
Left = 6600
TabIndex = 53
Top = 1800
Width = 1155
End
Begin VB.Label Label6
Caption = "总GPA"
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Left = 6720
TabIndex = 52
Top = 1080
Width = 975
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 11
Left = 5160
TabIndex = 51
Top = 8760
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 10
Left = 5160
TabIndex = 50
Top = 8040
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 9
Left = 5160
TabIndex = 49
Top = 7440
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 8
Left = 5160
TabIndex = 48
Top = 6720
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 7
Left = 5160
TabIndex = 47
Top = 6000
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 6
Left = 5160
TabIndex = 46
Top = 5280
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 5
Left = 5160
TabIndex = 45
Top = 4560
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 4
Left = 5160
TabIndex = 44
Top = 3960
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 3
Left = 5160
TabIndex = 43
Top = 3240
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 2
Left = 5160
TabIndex = 42
Top = 2520
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 1
Left = 5160
TabIndex = 41
Top = 1800
Width = 1095
End
Begin VB.Label Label5
BeginProperty Font
Name = "微软雅黑"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 495
Index = 0
Left = 5160
TabIndex = 40
Top = 1080
Width = 1095
End
Begin VB.Label Label4
Caption = "GPA"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 5280
TabIndex = 3
Top = 480
Width = 615
End
Begin VB.Label Label3
Caption = "分数"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 3840
TabIndex = 2
Top = 480
Width = 615
End
Begin VB.Label Label2
Caption = "学分"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 2760
TabIndex = 1
Top = 480
Width = 615
End
Begin VB.Label Label1
Caption = "科目"
BeginProperty Font
Name = "微软雅黑"
Size = 14.25
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 960
TabIndex = 0
Top = 480
Width = 615
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Dim GPA(11) As Double
Dim sum As Double
Dim GPAa As Double
Dim xuefen As Double
Dim jiaquan(11) As Double
Dim pingjun As Double
Dim jiaquanpingjun As Double
Private Sub Command1_Click()
sum = 0
xuefen = 0
pingjun = 0
For i = 0 To Text4.Text - 1
If Text3(i).Text >= 95 Then
Label5(i).Caption = 4.3
ElseIf Text3(i).Text >= 90 Then
Label5(i).Caption = 4
ElseIf Text3(i).Text >= 85 Then
Label5(i).Caption = 3.7
ElseIf Text3(i).Text >= 82 Then Label5(i).Caption = 3.3
ElseIf Text3(i).Text >= 78 Then Label5(i).Caption = 3
ElseIf Text3(i).Text >= 75 Then Label5(i).Caption = 2.7
ElseIf Text3(i).Text >= 72 Then Label5(i).Caption = 2.3
ElseIf Text3(i).Text >= 68 Then Label5(i).Caption = 2
ElseIf Text3(i).Text >= 65 Then Label5(i).Caption = 1.7
ElseIf Text3(i).Text >= 63 Then Label5(i).Caption = 1.3
ElseIf Text3(i).Text >= 60 Then Label5(i).Caption = 1
ElseIf Text3(i).Text < 60 Then Label5(i).Caption = 0
Else
MsgBox "格式错误!", vbOKOnly + vbCritical, "警告"
End If
Next
For i = 0 To Text4.Text - 1
GPA(i) = Text2(i).Text * Label5(i).Caption
jiaquan(i) = Text2(i) * Text3(i).Text
Next
For i = 0 To Text4.Text - 1
sum = sum + GPA(i)
xuefen = xuefen + Text2(i).Text
pingjun = pingjun + jiaquan(i)
Next
GPAa = sum / xuefen
jiaquanpingjun = pingjun / xuefen
Label7.Caption = GPAa
Label12.Caption = jiaquanpingjun
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -