下列程序的运行结果为( )。
Private Sub Command1_Click()
Score = Int(Rnd * 10) + 80
Select Case Score
Case ls < 60
a$ = "E"
Case 60 To 69
a$ = "D"
Case 70 To 79
a$ = "C"
Case 80 To 89
a$ = "B"
Case Else
a$ = "A"
End Select
Print a$
End Sub
Private Sub Command1_Click()
Score = Int(Rnd * 10) + 80
Select Case Score
Case ls < 60
a$ = "E"
Case 60 To 69
a$ = "D"
Case 70 To 79
a$ = "C"
Case 80 To 89
a$ = "B"
Case Else
a$ = "A"
End Select
Print a$
End Sub
举一反三
- 编写如下程序: Private Sub Command1_Click; Dim m As Integer, n As Integer m = 2 : n = 1 Select Case m Case 1 Select Case n Case 1 Print "AAA" Case 2 Print "BBB" End Select Case 2 Print "CCC" End Select End Sub 程序运行后,单击命令按钮Command1,输出结果为 A: BBB B: CCC C: AAA D: 1
- 中国大学MOOC: 下列程序的输入值为5,运行结果为( )。Private Sub Command1_Click() Dim a As Integer a = InputBox("请输入a的值") Select Case a Case 1 To 4 Print "D" Case 5 To 10 Print "C" Case 11 To 14 Print "B" Case Else Print "A" End SelectEnd Sub
- 下列程序段的运行结果为( )。 Dim x x = Int(Rnd) + 5 Select Case x Case 5 Print "优秀" Case 4 Print "良好" Case 3 Print "及格" Case Else Print "不及格" End Select
- 假定x的值为5,则在执行以下语句时,其输出结果为"Result"的正确表示Select Case语句是( ) A: Select Case x Case 1 To 10 Print "Result" End Select B: Select Case x Case Is>5,Is<5 Print "Result" End Select C: Select Case x Case Is>5,1,3 To 4 Print "Result" End Select D: Select Case x Case 1,3,Is>5 Print "Result" End Select
- 下列程序的输出结果是 。 Private Sub exam1() a = 1 For i = 1 To 3 Select Case i Case 1, 3 a = a + 1 Case 2, 4 a = a + 2 End Select Next i MsgBox a End Sub