2018年4月12日 星期四

計概15-07副程式與函數-檢定試題

【丙級電腦軟體應用試題】

201.具有後進先出(Last In Fast Out)的資料結構是 (1)佇列 (2)堆疊 (3)樹狀 (4)串列。[1100411-78]


【丙級電腦軟體設計試題】

201.BASIC語言中,若要求X值至小數點第一位(即第二位四捨五入),應用下列何敘述? (1)X = INT(X * 10) / 10 (2)X = INT(X * 10 + 0.5) / 10 (3)X = INT(X * 10) + 0.5 / 10 (4)X = INT(X * 100) + 0.5 / 100

 

302.有一BASIC函數程式如下,試問執行後結果為何? (1)0 (2)12 (3)60 (4)不能做。

10 DEF FNV(X, Y, Z) = X * Y * Z

20 H = 3: W = 4: L = 5

30 S = FNV(H, W, L)

40 PRINT S

50 END

3 * 4 * 5 = 60

 

203.下列BASIC程式執行結果為何? (1)36 (2)38 (3)40 (4)42

10 SUM = 0

20 FOR I = -10 TO 10

30  SUM = SUM  + INT(SQR(ABS(I)))

40 NEXT I

50 PRINT SUM

Sum = 0 + 3 + 3 + 2 + 2 + 2 + 2 + 2 + 1 + 1 + 1 + 0 + 1 + 1 + 1 + 2 + 2 + 2 + 2 + 2 + 3 + 3 = 38

 

304.下列BASIC語言程式執行結果為何? (1)39 (2)53 (3)56 (4)1439

10 DEF FNF(X) = X ^ 3 + X ^ 2 + X

20 FOR I = 1 TO 3

30  SUM = FNF(I) + SUM

40 NEXT I

50 PRINT SUM

SUM = FNF(1) + SUM = 1 ^ 3 + 1 ^ 2 + 1 + 0 = 3

SUM = FNF(2) + SUM = 2 ^ 3 + 2 ^ 2 + 2 + 3 = 17

SUM = FNF(3) + SUM = 3 ^ 3 + 3 ^ 2 + 3 + 17 = 56

 

305.下列BASIC程式片段,執行後輸出結果為何? (1)2.6 (2)52.6 (3)52 (4)53

A = INT(0.1 * 26 + 50): PRINT A

A = INT(0.1 * 26 + 50) = INT(2.6 + 50) = INT(52.6) = 52

 

206.下列取整數的INT函數運算,何者有誤? (1)INT(2)輸出值為2 (2)INT(-1.9)輸出值為-1 (3)INT(1.9)輸出值為1 (4)INT(2.1)輸出值為2

INT(-1.9) = -2

 

107.下列BASIC程式執行的結果為何? (1)-5 (2)5 (3)-15 (4)15

A = -5: B = -10

PRINT ABS(A) - ABS(B)

ABS(A) - ABS(B) = ABS(-5) - ABS(-10) = 5 - 10 = -5

 

108.下列BASIC程式的執行結果為何? (1)+A+BC+DEF+ (2)_A+BC+DEF_ (3)A+BC+DEF (4)無窮迴圈。

10 T$ = "A_BC_DEF_"

20 PO = INSTR(T$, "_")

30 WHILE PO > 0

40  MID$(T$, PO, 1) = "+"

50  PO = INSTR(PO, T$, "_")

60 WEND

 

209.下列BASIC程式執行後顯示為何 (1)ORNI (2)RNIN (3)NING (4)ING!

10 A$ = "MORNING!"

20 PRINT MID$(A$, 3, 4) "RNIN"

 

410.BASIC語言中,若X$ = "ABCDE",則下列何者正確? (1)LEFT$(X$, 2) = MID$(X$, 2, 4) (2)RIGHT$(X$, 2) = MID$(X$, 2, 4) (3)LEFT$(X$, 2) = MID$(X$, 4, 2) (4)RIGHT$(X$, 2) = MID$(X$, 4, 2)

RIGHT$(X$, 2) = MID$(X$, 4, 2) = "DE"

 

211.下列BASIC程式執行後,印出結果為何? (1)ABC (2)AAA (3)ABB (4)AAE

10 A$ = "ABCDE"

20 B$ = MID$(A$, 1, 1) + LEFT$(A$, 1) + CHR$(65) "A" + "A" + "A" "AAA"

30 PRINT B$

40 END

 

212.下列BASIC程式片段,執行後結果顯示為 (1)P4.5 (2)111 (3)NES111 (4)JON

10 LET R$ = "JONES111P4.5"

20 W$ = MID$(R$, 6, 3) "111"

30 PRINT W$

40 END

 

113.BASIC語言中,下列何者為PRINT CHR$(48)的結果? (1)0 (2)1 (3)48 (4)49

 

414.下列BASIC語言程式片段,其執行結果為何? (1)234 (2)4567 (3)567 (4)456

5 I = 4

10 A$ = "1234567890"

20 B$ = MID$(A$, I, 3) "456"

30 PRINT B$

 

115.下列BASIC語言程式片段,其執行結果為何? (1)COMP (2)UTER (3)COMPUTER (4)COMPUT

10 A$ = "COMPUTER"

20 PRINT LEFT$(A$, LEN(A$) / 2)

30 END

LEFT$(A$, LEN(A$) / 2) = LEFT$(A$, 8 / 2) = LEFT$(A$, 4) = "COMP"

 

216.下列BASIC語言程式片段,其執行結果為何? (1)"97" (2)"7 4" (3)"748" (4)"48"

10 A = 48: X$ = "97"

20 PRINT MID$(X$ + STR$(A), 2, 3)

MID$(X$ + STR$(A), 2, 3) = MID$(X$ + "48"), 2, 3) = MID$("9748", 2, 3) = "74"

 

217.下列BASIC語言程式片段,其執行結果為何? (1)"2D" (2)23 (3)"23" (4)123

10 A$ = "ABC123DEF"

20 PRINT VAL(LEFT$(RIGHT$(A$, 5), 2))

VAL(LEFT$(RIGHT$(A$, 5), 2)) = VAL(LEFT$("23DEF", 2)) = VAL("23") = 23

 

218.BASIC語言中,下列何者為PRINT MID$("資料處理科 Happy", 7, 6)結果? (1)appy (2)理科 Ha (3) Happy (4)Error

 

319.BASIC語言中,若字串變數A$中之值為"ABCDEF",而字串變數B中之值為"WXYZ",則MID$(A$, 3, 2) + MID$(B$, 2, 2)之結果為 (1)ABCWX (2)DEFYZ (3)CDXY (4)DEYZ

MID$(A$, 3, 2) + MID$(B$, 2, 2) = "CD" + "XY" = "CDXY"

 

220.下列BASIC語言程式片段,其執行的結果為何?(1)COMAL (2)PETER (3)RSONALPUTER (4)TERPE

10 A$ = "PERSONAL"

20 B$ = "COMPUTER"

30 PRINT LEFT$(A$, 2) + RIGHT$(B$, 3)

40 END

LEFT$(A$, 2) + RIGHT$(B$, 3) = "PE" + "TER" = "PETER"

 

沒有留言:

張貼留言

注意:只有此網誌的成員可以留言。