執行Visual Basic程序的測試題(doc 76頁)
執行Visual Basic程序的測試題(doc 76頁)內容簡介
執行Visual Basic程序的測試題內容提要:
( ) 1.執行下列Visual Basic語言片段程序的結果為何?
X = 110
If X < 100 Then
Y = 1
Else
Y = 2
If X > 120 Then
Y = 3
End If
End If
Print Y
(A)1 (B)2 (C)3 (D)110
( ) 2.下列這段BASIC程序代碼,可以由身高及性別計算標準體重,計算後所印出的Weight值為何?
Sex = "F"
Height = 170
If Sex = "M" then
Weight = (Height - 80) * 0.7
Else
Weight = (Height - 70) * 0.6
End If
Print Weight
(A)54 (B)56 (C)60 (D)63
( ) 3.執行下列Visual Basic程序片段後,Max值為何?
A =10: B = 20
If A > B Then
Max = A
Else
Max = B
End If
(A)10 (B)20 (C)30 (D)Max
( ) 4.執行下列Visual Basic程序後,輸出的結果為何?
x = 10: y = 4
If x > = 10 And y < 6 Then
Print "Happy
End If
Print "Birthday"
(A)HappyBirthday (B)Happy (C)BirthdayHappy (D)Birthday
( ) 5.執行下列Visual Basic程序後,輸出的結果為何?
X = 13
X = X + 10
IF X >= 30 THEN X = X - 20
PRINT X
(A)3 (B)13 (C)23 (D)43
( ) 6.在Visual Basic程序語言中,下列何種指令最適合用於多重選擇結構中?
(A)Do...Loop (B)For...Next (C)Option Base (D)Select...Case
( ) 7.執行下列Visual Basic程序後,輸出的結果為何?
A = 1: B = 2
If A > 1 Then B = B + 3
Print B
(A)1 (B)2 (C)3 (D)5
( ) 8.下列程序敘述中,何者可用來判斷BMI值介於18至24之間?
(A)If BMI >= 18 Or BMI <= 24 (B)If BMI = 18 And BMI = 24 (C)If BMI >= 18 And BMI <= 24 (D)If BMI =18 Or BMI = 24
( ) 9.執行下列Visual Basic程序後,輸出的結果為何?
x = 4: y = 1
Select Case x
Case 1 To 3: y = x + 3 * y
Case 4 To 6: y = x + 5 * y
Case 7 To 9: y = x + 7 * y
End Select
Print y
(A)5 (B)9 (C)10 (D)12
( ) 10.下列Visual Basic程序之執行結果為何?
A = 3: B = 2: C = 1
If B < A Then
C = B + A
End If
Print C
(A)C = 1 (B)C = 2 (C)C = 3 (D)C = 5
( ) 11.下列是一個利用巢狀If判斷敘述來檢查大月(1、3、5、7、8、10、12月)之日期是否合理的程序片段,請問空格處應填入哪一個條件式,才能判斷日期是否合理(假設變量d儲存日期數據)?
If m = 1 Or m = 3 Or m = 5 Or m = 7 Or m = 8 Or m = 10 Or m = 12 Then
If _______________________ Then
MsgBox ("輸入的日期合理")
Else
MsgBox ("輸入的日期不合理")
End If
End If
(A)d = 1 ~ 31 (B)d >= 1 And d <= 31 (C)d <= 31 (D)d >= 1
( ) 12.在程序設計的觀念中,先測試某一條件再依結果改變執行路徑的結構屬於
(A)循序結構 (B)隨機結構 (C)選擇結構 (D)多元結構
( ) 13.執行下列Visual Basic程序後,輸出的結果為何?
a = 3: b = 5: c = 4
If a > b Then
If b > c Then Print a;
Else
Print b;
End If
Print c
(A)4 (B)34 (C)54 (D)354
( ) 14.執行下列Visual Basic程序後,輸出的結果為何?
Y = -1
If Y > 1 Or Y <= -1 Then Print "1
If Y >= -1 And Y <= 0 Then Print "2
If Y > 0 And Y <= 1 Then Print "3
Print Y + 1
(A)123 (B)23 (C)120 (D)124
( ) 15.下列Visual Basic程序執行後,總共輸出幾個$?
Private Sub Form_Activate( )
X = 3 \ 2
Select Case X
Case 1: Print "$"
Case 2: Print "$$"
Case Else: Print "$$$"
End Select
End Sub
(A)1 (B)2 (C)3 (D)6
…………
..............................
( ) 1.執行下列Visual Basic語言片段程序的結果為何?
X = 110
If X < 100 Then
Y = 1
Else
Y = 2
If X > 120 Then
Y = 3
End If
End If
Print Y
(A)1 (B)2 (C)3 (D)110
( ) 2.下列這段BASIC程序代碼,可以由身高及性別計算標準體重,計算後所印出的Weight值為何?
Sex = "F"
Height = 170
If Sex = "M" then
Weight = (Height - 80) * 0.7
Else
Weight = (Height - 70) * 0.6
End If
Print Weight
(A)54 (B)56 (C)60 (D)63
( ) 3.執行下列Visual Basic程序片段後,Max值為何?
A =10: B = 20
If A > B Then
Max = A
Else
Max = B
End If
(A)10 (B)20 (C)30 (D)Max
( ) 4.執行下列Visual Basic程序後,輸出的結果為何?
x = 10: y = 4
If x > = 10 And y < 6 Then
Print "Happy
End If
Print "Birthday"
(A)HappyBirthday (B)Happy (C)BirthdayHappy (D)Birthday
( ) 5.執行下列Visual Basic程序後,輸出的結果為何?
X = 13
X = X + 10
IF X >= 30 THEN X = X - 20
PRINT X
(A)3 (B)13 (C)23 (D)43
( ) 6.在Visual Basic程序語言中,下列何種指令最適合用於多重選擇結構中?
(A)Do...Loop (B)For...Next (C)Option Base (D)Select...Case
( ) 7.執行下列Visual Basic程序後,輸出的結果為何?
A = 1: B = 2
If A > 1 Then B = B + 3
Print B
(A)1 (B)2 (C)3 (D)5
( ) 8.下列程序敘述中,何者可用來判斷BMI值介於18至24之間?
(A)If BMI >= 18 Or BMI <= 24 (B)If BMI = 18 And BMI = 24 (C)If BMI >= 18 And BMI <= 24 (D)If BMI =18 Or BMI = 24
( ) 9.執行下列Visual Basic程序後,輸出的結果為何?
x = 4: y = 1
Select Case x
Case 1 To 3: y = x + 3 * y
Case 4 To 6: y = x + 5 * y
Case 7 To 9: y = x + 7 * y
End Select
Print y
(A)5 (B)9 (C)10 (D)12
( ) 10.下列Visual Basic程序之執行結果為何?
A = 3: B = 2: C = 1
If B < A Then
C = B + A
End If
Print C
(A)C = 1 (B)C = 2 (C)C = 3 (D)C = 5
( ) 11.下列是一個利用巢狀If判斷敘述來檢查大月(1、3、5、7、8、10、12月)之日期是否合理的程序片段,請問空格處應填入哪一個條件式,才能判斷日期是否合理(假設變量d儲存日期數據)?
If m = 1 Or m = 3 Or m = 5 Or m = 7 Or m = 8 Or m = 10 Or m = 12 Then
If _______________________ Then
MsgBox ("輸入的日期合理")
Else
MsgBox ("輸入的日期不合理")
End If
End If
(A)d = 1 ~ 31 (B)d >= 1 And d <= 31 (C)d <= 31 (D)d >= 1
( ) 12.在程序設計的觀念中,先測試某一條件再依結果改變執行路徑的結構屬於
(A)循序結構 (B)隨機結構 (C)選擇結構 (D)多元結構
( ) 13.執行下列Visual Basic程序後,輸出的結果為何?
a = 3: b = 5: c = 4
If a > b Then
If b > c Then Print a;
Else
Print b;
End If
Print c
(A)4 (B)34 (C)54 (D)354
( ) 14.執行下列Visual Basic程序後,輸出的結果為何?
Y = -1
If Y > 1 Or Y <= -1 Then Print "1
If Y >= -1 And Y <= 0 Then Print "2
If Y > 0 And Y <= 1 Then Print "3
Print Y + 1
(A)123 (B)23 (C)120 (D)124
( ) 15.下列Visual Basic程序執行後,總共輸出幾個$?
Private Sub Form_Activate( )
X = 3 \ 2
Select Case X
Case 1: Print "$"
Case 2: Print "$$"
Case Else: Print "$$$"
End Select
End Sub
(A)1 (B)2 (C)3 (D)6
…………
..............................
用戶登陸
信息技術熱門資料
信息技術相關下載