用VB怎么做学生成绩等级排序的程序?
1个回答
展开全部
VB中添加一个按钮点击就可以了
Private Sub Command1_Click()
a = InputBox("请输入分数:")
If IsNumeric(a) And a <= 100 And a >= 0 Then
Select Case a
Case 0 To 59
dd = "E"
Case 60 To 69
dd = "D"
Case 70 To 79
dd = "C"
Case 80 To 89
dd = "B"
Case 90 To 100
dd = "A"
Case Else
dd = "成绩错误!"
End Select
MsgBox dd
Else
MsgBox "你输入的成绩非法"
End If
End Sub
Private Sub Command1_Click()
a = InputBox("请输入分数:")
If IsNumeric(a) And a <= 100 And a >= 0 Then
Select Case a
Case 0 To 59
dd = "E"
Case 60 To 69
dd = "D"
Case 70 To 79
dd = "C"
Case 80 To 89
dd = "B"
Case 90 To 100
dd = "A"
Case Else
dd = "成绩错误!"
End Select
MsgBox dd
Else
MsgBox "你输入的成绩非法"
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询