编写如下程序:PrivateSubCommand1_Click()DimscoreAsIntegerscore=90Ifscore>80Thenr=5ElseIfscore>60Thenr=3Elser=1EndIfPrintrEndSub程序运行后,单击命令按钮Command1,输出结果为(______)。(5.0分)
举一反三
- 编写如下程序: Private Sub Command1_Click() Dim score As Integer score = 90 If score > 80 Then r = 5 ElseIf score > 60 Then r = 3 Else r = 1 End If Print r End Sub 程序运行后,单击命令按钮Command1,输出结果为(______)。
- 在窗体上画一个命令按钮<其名称为Command1),然后编写如下事件过程: Private Sub Command1 Click() For i=1 T04 If i=1 Thenx=i If i<=4 Then x=x+1 Print x Next i End Sub 程序运行后,单击命令按钮;其输出结果为 ______。 A: A) 1 2 3 4 B: B) 2 3 4 5 C: C) 2 3 4 4 D: D) 3 4 5 6
- 在窗体中添加一个命令按钮(名为Command1),然后编写如下代码: Private Sub Command1 Click( ) A=75 If A>60 Then I=1 If A>70 Then I=2 If A>80 Then I=3 If A>90 Then I=4 MsgBox I End Sub 窗体打开运行后,单击命令按钮,则消息框的输出结果是______。 A: 1 B: 2 C: 3 D: 4
- 编写如下程序: Private Sub Command1_Click() Dim n As Integer : Static s As Integer For n = 1 To 3 s = s + n Next Print s End Sub 程序运行后,第三次单击命令按钮Command1时,输出结果为
- 在窗体中添加一个命令按钮Command1,并编写如下程序: PrivateSubCommand1_Click() x=InputBox(x) Ifx^2=9Theny=x Ifx^2<9Theny=1/x Ifx^2>9Theny=x^2+1 Printy EndSub 程序运行时,单击命令按钮,在InputBox中输入3,然后单击“确定”按钮,程序的运行结果为()。