VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   4680
   StartUpPosition =   3  '窗口缺省
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   375
      Left            =   3000
      TabIndex        =   0
      Top             =   2760
      Width           =   1095
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Click()
    Dim xf%(1 To 5), mark%(1 To 5), jd%, i%, sumxf%, sumxfmark%
    For i = 1 To 5
      xf(i) = Val(InputBox("输入学分"))
      mark(i) = Val(InputBox("输入成绩"))
    Next i
    sumxf = 0
    sumxfmark = 0
    For i = 1 To 5
      sumxf = sumxf + xf(i)
      Select Case mark(i)
        Case Is >= 90
           jd = 4
        Case Is >= 80
           jd = 3
        Case Is >= 70
           jd = 2
        Case Is >= 60
           jd = 1
        Case Else
           jd = 0
      End Select
      sumxfmark = sumxfmark + xf(i) * jd
    Next i
    averjd = sumxfmark / sumxf
    Print averjd
End Sub

