2020年9月计算机二级VB基础巩固题及答案(11)
1.以下程序段:
Private Sub Form_Load( )
Dim Nop As Integer, Op As String * 1
Num1 = 3
Num2 = 2
Nop = val(Inputbox("请输入1-4之间的整数"))
Select Case Nop
Case 1
Op = "+"
Result = Num1 + Num2
Case 2
Op = "-"
Result = Num1 - Num2
Case 3
Op = "×"
Result = Num1 * Num2
Case 4
Op = "÷"
Result = Num1 / Num2
End Select
Label1= Num1 & Op & Num2 & "=" & Result
End Sub
窗体运行后,输入2,则label1的标题显示结果为(B)(单)
A.3+2=5
B.3-2=1
C.3×2=6
D.3÷2=1.5
2.以下程序段:
Private Sub Form_Load( )
Dim Nop As Integer, Op As String * 1
Num1 = 3
Num2 = 2
Nop = val(Inputbox("请输入1-4之间的整数"))
Select Case Nop
Case 1
Op = "+"
Result = Num1 + Num2
Case 2
Op = "-"
Result = Num1 - Num2
Case 3
Op = "×"
Result = Num1 * Num2
Case 4
Op = "÷"
Result = Num1 / Num2
End Select
Label1= Num1 & Op & Num2 & "=" & Result
End Sub
窗体运行后,输入3,则label1的标题显示结果为(C)(单)
A.3+2=5
B.3-2=1
C.3×2=6
D.3÷2=1.5
3.以下程序段:
Private Sub Form_Load( )
Dim Nop As Integer, Op As String * 1
Num1 = 3
Num2 = 2
Nop = val(Inputbox("请输入1-4之间的整数"))
Select Case Nop
Case 1
Op = "+"
Result = Num1 + Num2
Case 2
Op = "-"
Result = Num1 - Num2
Case 3
Op = "×"
Result = Num1 * Num2
Case 4
Op = "÷"
Result = Num1 / Num2
End Select
Label1= Num1 & Op & Num2 & "=" & Result
End Sub
窗体运行后,输入4,则label1的标题显示结果为(D)(单)
A.3+2=5
B.3-2=1
C.3×2=6
D.3÷2=1.5
编辑推荐:
温馨提示:因考试政策、内容不断变化与调整,长理培训网站提供的以上信息仅供参考,如有异议,请考生以权威部门公布的内容为准! (责任编辑:长理培训)
点击加载更多评论>>