VB等級考試2019 上

2022-11-18 16:18:02 字數 4152 閱讀 4205

2023年春浙江省高等學校

計算機等級考試試卷(二級visual basic)

說明: 考生應將所有試題的答案填寫在答卷上。其中試題1~試題6,請在答卷上各小題正確選項的對應位置處填「√」;

請將你的准考證號的後五位填寫在答卷右下角的指定位置內;

考試時間為90分鐘;

試題1(每小題3分,共12分)

閱讀下列程式說明和程式,在每小題提供的若干可選答案中,挑選乙個正確答案。

【程式說明】輸入n後,計算並顯示下列表示式的值。

執行時初始介面如下圖左所示,輸入10並按回車鍵後的介面如下圖中所示(輸入數若小於1則清空文字框,需重新輸入),按「計算」按鈕後的介面如下圖右所示。

【程式】

dim n as integer

private sub form_load()

command1. (1

end sub

private sub text1_(2k as integer)

if k <> 13 then exit sub

(3if n > 0 then

= true

= false

else

= ""

end if

end sub

private sub command1_click()

dim y as single, i as integer

for i = 1 to n

(4next i

= y= false

= true

= ""

end sub

【供選擇的答案】

(1) a、enabled=true b、enabled=false c、visible=true d、visible=false

(2) a、keypress b、clickc、change d、keydown

(3) a、k= b、k = 13c、n = 13 d、n =

(4) a、y = y + 1/n b、y = y + 1\n c、y = y + 1/i d、y = y + 1\i

試題2(每小題3分,共12分)

閱讀下列程式說明和程式,在每小題提供的若干可選答案中,挑選乙個正確答案。

【程式說明】執行時輸入10個數後,輸出其中較小的5個數。

【程式】

private sub command1_click()

dim a(10) as single, t as single, i as byte, j as byte, k as byte

for i = 1 to 10

a(i) = inputbox( (5) )

next i

for i = 1 to 9

(6for j = i + 1 to 10

if (7then k = j

next j

t = a(i): a(i) = a(k): a(k) = t

next i

for i = (8

print a(i)

next i

end sub

【供選擇的答案】

(5) a、"a(" & ib、"a(" + i + ")="

c、"a(" , id、"a(" ; i ; ")="

(6) a、k = ib、i = kc、k = i + 1 d、i = k + 1

(7) a、a(j) < a(i) b、a(j) > a(i) c、a(j) > a(k) d、a(j) < a(k)

(8) a、5 to 1b、10 to 6 c、1 to 5d、5 to 10

試題3(每小題3分,共12分)

閱讀下列程式說明和程式,在每小題提供的若干可選答案中,挑選乙個正確答案。

【程式說明】單擊command1以通用對話方塊控制項選擇圖象檔案並載入,如下圖左所示。單擊**框控制項p1後,將以單擊處為圓心、p1寬度的三分之一為半徑的圓之外的區域改為白色。下圖右是滑鼠單擊頭像鼻翼處的處理效果。

窗體載入後,p1的座標單位應為畫素。

【程式】

private sub command1_click() '載入**

commondialog1. (9

= loadpicture(

end sub

private sub (10

= 3設定p1的座標單位為畫素

end sub

private sub p1_mousedown(button as integer, _

shift as integer, x as single, y as single)

dim r as long, i as long, j as long

r = / 3

for i = to +

for j = to +

if (i - x) ^ 2 + (j - y) ^ 2 (11r * r then _

(i, j), (12

next j

next i

end sub

【供選擇的答案】

( 9) a、action b、showopen c、showfont d、action = 3

(10) a、form_load() b、form_click() c、p1_load() d、p1_click()

(11) a、c、<>d、 =

(12) a、whiteb、rgb(0,0,255) c、vbwhite d、rgb(255,0,0)

試題4(每小題3分,共12分)

閱讀下列程式並回答問題,在每小題提供的若干可選答案中,挑選乙個正確答案。

【程式】

private sub command1_click()

dim n as integer, i as integer, j as integer

n = inputbox("n=")

redim a(2 to n) as integer

for i = 2 to n

a(i) = i

next i

for i = 2 to sqr(n)

if a(i) <> 0 then

for j = 2 * i to n step i

a(j) = 0

next j

end if

next i

for i = 2 to n

if a(i)<>0 then i

next i

end sub

【供選擇的答案】

(13) 單擊command1輸入4後,列表框控制項逐行顯示:

a、1,2b、2,3c、3,4 d、2

(14) 單擊command1輸入6後,列表框控制項逐行顯示:

a、2,3,5 b、2,3c、3,5 d、2,4

(15) 單擊command1輸入8後,列表框控制項逐行顯示:

a、3,5b、2,4,6 c、3,5,7 d、2,3,5,7

(16) 該事件過程的功能是,輸入n後:

a、顯示小於n的奇數b、小於n的偶數

c、顯示小於n的素數d、顯示不大於n的素數

試題5(每小題3分,共12分)

閱讀下列程式並回答問題,在每小題提供的若干可選答案中,挑選乙個正確答案。

【程式】

private function f(byval a as integer, byval b as integer) as integer

dim r as integer

r = a mod b

while r <> 0

a = b: b = r: r = a mod b

wend

f = b

end function

private sub command1_click()

dim m as integer, n as integer

m = inputbox("m="): n = inputbox("n=")

print f(m, n); m; n

end sub

VB等級考試選擇填空總結 第7套

1.用鍊錶表示線性表的優點是 a 便於插入和刪除操作 2.為了避免流程圖在描述程式邏輯時的靈活性,提出了用方框圖來代替傳統的程式流程圖,通常也把這種圖稱為 b n s圖 3.下面對物件概念描述錯誤的是 a a 任何物件都必須有繼承性 b 物件是屬性和方法的封裝體 c 物件間的通訊靠訊息傳遞 d 操作...

計算機等級考試二級VB全真模擬試題

chinaitlab 點選 9045 更新 2005 6 28 一 選擇題 35題,2分 題,共70分 下列各題a b c d 四個選項中,只有乙個選項是正確的,請將正確選項塗寫在答題卡相應位置上,答在試卷上不得分。1.當執行程式時,系統自動執行啟動窗體的某個事件過程。這個事件過程是 a a loa...

計算機等級考試二級VB全真模擬試題含答案 2

一 選擇題 1 35 題每題2分,共70分。下列各題a b c d 四個先項中,只有乙個選擇是正確的,請將正確選項塗寫在答題卡相應位置上,答在試卷上不得分。1 下列不能開啟屬性視窗的操作是 a 執行 檢視 選單中的 屬性視窗 命令 b 按f4鍵 c 按ctrl t d 單擊工具欄上的 屬性視窗 按鈕...