急谁能帮我做一道visual basic 程序题...

来源:百度知道 编辑:UC知道 时间:2024/05/09 16:23:39
题目:输入一个分数,并判断其等级.

使用elself表达多个条件...)
( < 60 ..不及格..
< 80...及格...
< 90...良好...
< 100..优秀...
= 100...满分...)
外部控件用设置什么吗?

控件 text1 ,label1
代码
Private Sub Text1_Change()
If Text1.Text = "" Then
Label1.Caption = "请输入分数"
else

If Int(Text1.Text) < 60 Then
Label1.Caption = "不及格"
ElseIf Int(Text1.Text) >= 60 And Int(Text1.Text) < 80 Then
Label1.Caption = "及格"
ElseIf Int(Text1.Text) >= 80 And Int(Text1.Text) < 90 Then
Label1.Caption = "良好"
ElseIf Int(Text1.Text) >= 90 And Int(Text1.Text) < 100 Then
Label1.Caption = "优秀"
ElseIf Int(Text1.Text) = 100 Then
Label1.Caption = "满分"
End If
end if
End Sub

a=分数
if a< 60 then
msgbox "不及格"
elseif a<80 then
msgbox "及格"
elseif a<90 then
msgbox "良好"
elseif a<100 then
msgbox "优秀"
elseif a=100 then
msgbox "满分"
end if