分别使用if语句和select语句编写一个成绩等级判定程序,[90,100]为优秀,[80,90)为良好,[70,80)为中,[
分别使用if语句和select语句编写一个成绩等级判定程序,[90,100]为优秀,[80,90)为良好,[70,80)为中,[60,70)为及格,[0,60)为不及格。...
分别使用if语句和select语句编写一个成绩等级判定程序,[90,100]为优秀,[80,90)为良好,[70,80)为中,[60,70)为及格,[0,60)为不及格。
展开
展开全部
Private Sub Pro1()
Dim Score As Single
Score = InputBox(prompt, "输入成绩", 0)
Select Case Val(Score)
Case Is >= 90
MsgBox "优秀"
Case Is >= 80
MsgBox "良好"
Case Is >= 70
MsgBox "中等"
Case Is >= 60
MsgBox "及格"
Case Else
MsgBox "不及格"
End Select
End Sub
Private Sub Pro2()
Dim Score As Single
Score = InputBox(prompt, "输入成绩", 0)
If Val(Score) >= 90 Then
MsgBox "优秀"
Exit Sub
End If
If Val(Score) >= 80 Then
MsgBox "良好"
Exit Sub
End If
If Val(Score) >= 70 Then
MsgBox "中等"
Exit Sub
End If
If Val(Score) >= 60 Then
MsgBox "及格"
Exit Sub
End If
MsgBox "不及格"
End Sub
Dim Score As Single
Score = InputBox(prompt, "输入成绩", 0)
Select Case Val(Score)
Case Is >= 90
MsgBox "优秀"
Case Is >= 80
MsgBox "良好"
Case Is >= 70
MsgBox "中等"
Case Is >= 60
MsgBox "及格"
Case Else
MsgBox "不及格"
End Select
End Sub
Private Sub Pro2()
Dim Score As Single
Score = InputBox(prompt, "输入成绩", 0)
If Val(Score) >= 90 Then
MsgBox "优秀"
Exit Sub
End If
If Val(Score) >= 80 Then
MsgBox "良好"
Exit Sub
End If
If Val(Score) >= 70 Then
MsgBox "中等"
Exit Sub
End If
If Val(Score) >= 60 Then
MsgBox "及格"
Exit Sub
End If
MsgBox "不及格"
End Sub
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询