一、選擇題((1)-(40)題每題1分,(41)-(50)題每題2分,共60分)
下列各題a) 、b)、c)、d)四個選項中,只有一個選項是正確的,請將正確的選項涂寫在答題卡相應位置上,答在試卷上不得分。
(l) 在計算機系統(tǒng)中,一個字節(jié)的二進制位數(shù)為
a) 16 b) 8 c) 4 d) 由 cpu的型號決定
(2) 存儲 16×16點陣的一個漢字信息,需要的字節(jié)數(shù)為
a) 32 b) 64 c) 128 d) 256
(3) 英文大寫字母b的ascii碼為42h,英文小寫字母b的ascii碼為
a) 43h b) 84h c) 74h d) 62h
(4) 下列計算機語言中,cpu能直接識別的是
a) 自然語言 b) 高級語言 c) 匯編語言 d)機器語言
(5) 在計算機領域中,所謂“裸機”是指
a) 單片機 b) 單板機
c) 不安裝任何軟件的計算機 d) 只安裝操作系統(tǒng)的計算機
(6) 下列帶有通配符的文件名中,能代表文件abcdef.dat的是
a) a*.* b) ?f.* c) *.? d) ab?.*
(7) 下列dos命令中,執(zhí)行時不會發(fā)生錯誤的是
a) type *.txt b) dir *.txt
c) ren a.txt a:b.txt d) copy *.txt>con
(8) 設當前盤為c盤,c盤的當前目錄為\a\b\c。下列dos 命令中能正確執(zhí)行的是
a) md \ b) md a:\ c) md \a\b d) cd c:
(9) 為了將c:user中的文件file.txt同名復制到a盤根目錄下,下列dos命令中能正確執(zhí)行的是
a) type c:\user\file.txt > a:\file.txt
b) type c:\user\file.txt a:\file.txt
c) copy c:\user\file.txt > a:\file.txt
d) copy c:\user\file.txt
(10) 在windows下,當一個應用程序窗口被最小化后,該應用程序
a) 終止運行 b) 暫停運行 c) 繼續(xù)在后臺運行 d) 繼續(xù)在前臺運行
(11) 在windows環(huán)境下,下列操作中與剪貼板無關的是
a) 剪切 b) 復制 c) 粘貼 d) 刪除
(12) 在windows環(huán)境下,實現(xiàn)窗口移動的操作是
a) 用鼠標拖動窗口中的標題欄 b) 用鼠標拖動窗口中的控制按鈕
c) 用鼠標拖動窗口中的邊框 d) 用鼠標拖動窗口中的任何部位
(13) 一臺計算機連入計算機網(wǎng)絡后,該計算機
a) 運行速度會加快 b) 可以共享網(wǎng)絡中的資源
c) 內(nèi)存容量變大 d) 運行精度會提高
(14) 不能作為計算機網(wǎng)絡中傳輸介質(zhì)的是
a) 微波 b) 光纖 c) 光盤 d) 雙絞線
(15) 下列各項中,不屬于多媒體硬件的是
a) 聲卡 b) 光盤驅(qū)動器 c) 顯示器 d) 多媒體制作工具
(16) qbasic中,裝入一個已有文件,應使用菜單file下的命令:
a) new b) open c) save d) exit
(17) 如果想觀察一個qbasic程序中的各個子程序和函數(shù),應使用菜單view下的命令:
a) new b) split c) subs d) output screen
(18) 下面敘述正確的是
a) 程序的行號或標號與程序的執(zhí)行完全無關
b) 程序的行號或標號是程序執(zhí)行順序的唯一依據(jù)
c) 同一個程序段中不能有相同的二個行號或標號
d) 同一個程序段中,必須統(tǒng)一用行號或標號,不能有的用行號有的用標號
(19) 在qbasic中,常量8888888&的數(shù)據(jù)類型是
a) 整型 b) 實型 c) 雙精度型 d) 長整型
(20) 下面四項中不能作為qbasic變量名的是
a) xyz.xyz b) uvwxyz123456 c) sincos d) 123xyz
(21) 在qbasic中,執(zhí)行下面四個語句,將得到錯誤信息的是
a) ?sgn(0) b) ?asc(“0”) c) ?abs(0) d) ?cos(“0”)
(22) 表達式fix(-23.87)+int(24.56)的值為
a) 0 b) 1 c) -1 d) 2
(23) 四個字符“d”,“z”,“a”,“9”的ascii碼值最大的是
a) “d” b) “z” c) “a” d) “9”
(24) m,n是整數(shù),且n>m,在以下四個語句中,能將x賦值為一個m-n之間(含m,n)任意整數(shù),即滿足m≥x≥n的是
a) x=int(rnd*(n-m+1))+m b) x=int(rnd*n)+m
c) x=int(rnd*m)+n d) x=int(rnd*(n-m))+m
(25) 在以下四個邏輯表達式中,其邏輯值為“真”的是
a) not(3+5<4+6) b) 2>1 and 3<2 c) 1>2 or 2>3 d) not(1>2)
(26) 下面的四項敘述中錯誤的是
a) 在一行中有多條語句時,逗號“,”可作為語句間的分隔符
b) 在print語句中,有多個輸出項時逗號“,”可作為輸出項間的分隔
c) 一個dim語句定義多個數(shù)組時,逗號“,”可作為數(shù)組間的分隔符
d) 在read語句中,有多個變量時逗號“,”可作為變量間的分隔符
(27) 表達式“turbo”+“c”>“true”+“basci”的值是
a) 0 b) 1 c) –1 d) 2
(28) 語句dim arr(-3 to 5, 2 to 6)as integer定義的數(shù)組元素有
a) 45個 b) 40個 c) 11個 d) 54個
(29) 下面四組程序成分中語法正確的是
a) def fncdy(n) b) def cdy(n)
cdy=2*3.1416*n cdy=2*3.1416*n
fncdy=cdy end cdy
end def
c) def fncdy() d) def fncdy(n)
cdy=2*3.1416*n cdy=2*3.1416*n
fncdy()=cdy end fncdy
end def
(30) 有如下程序
a=3:b=4
print bend
運行后,輸出的結果是
a) 4>3 b) -1 c) 0 d) 顯示出錯信息
(31) 有如下程序
a=0
for j=1 to 20 step 2
a=a+j\5
next j
print a
end
運行后,輸出的結果是
a) 12 b) 16 c) 40 d) 100
(32) 有如下程序
s=0
i=1
do while i<=100
if i mod 10<>0 then
s=s+i
i=i+1
else
i=i+1
end if
loop
print s
end
運行后的輸出結果是
a) 4050 b) 5050 c) 5000 d) 4500
(33 ) 有如下一組程序語句
dim zxs as integer
zxs%=232
zxs=232.32
print zxs%,zxs
運行時的輸出結果是
a) 232 232.32 b) 232 232 c) 232.32 232.32 d) 顯示出錯信息
(34) 有如下一組程序語句
defstr c-f
d$=“321”
f=“654”
print d+f$
運行時的輸出結果是
a) 321654 b) “321654” c) 321+“654” d) 顯示出錯信息
(35) 有如下程序
c=70
for k=11 to 20
read x
if xd=d+x:c=x
else
d=d+c
end if
next k
print d
data 75,55,45,80,30,25,40,15,20,5
end
運行時的輸出結果是
a) 335 b) 330 c) 390 d) 485
(36) 有如下程序
xcase=1
input “input value of t:”;t
select case t
case is>0
y=xcase+1
case is=0
y=xcase+2
case else
y=xcase+3
end select
print xcase;y
end
運行時,從鍵盤輸入1,輸出的結果是
a) 1 2 b) 1 1 c) 1 3 d) 1 4
(37) 有如下程序
a=3
if a<=3 then
print 3;
end if
if a<=4 then
print 4;
endif
if a<=5 then
print 5;
end if
if a<=6 then
print 6;
end if
print
end
運行后輸出結果是
a) 3 b) 3 4 c) 3 4 5 d) 3 4 5 6
(38) 有如下程序
a$=“54321”:b$=“abcde”
for j=1 to 5
print mid$(a$,6-j,1)+mid$(b$,j,1);
next j
print
end
運行后輸出結果是
a) a1b2c3d4e5 b) a5b4c3d2e1 c) 1a2b3c4d5e d) e1d2c3b4a5
(39) 有如下程序
const st$=“china”
st$=“great”
st$=“hebei”
end
print st$
end
運行后輸出結果是
a) china b) great c) hebei d) 顯示出錯信息
(40) 有如下程序
for m=1 to 4
a=0
for j=1 to 5
a=1
for k=1 to 6
a=a+3
next k
next j
next m
print a
end
運行后輸出結果是
a) 18 b) 19 c) 90 d) 360
(41) 在文本模式下,屏幕上顯示的最小單位是
a) 一條直線 b) 一個小圓
c) 一個字符 d) 一個顯象管的象素點(象元)
(42) 有如下程序
declare sub a(m,n)
m=5: n=4
call a((m),n)
print m,n
end
sub a(m,n)
s=m
m=s/n
n=s mod n
end sub
運行后輸出結果是
a) 1 1 b) 5 4 c) 1 4 d) 5 1
(43) 有如下程序
x=0
for k=3 to 5
gosub ab;
s=s+x
next k
print s
end
ab: x=x+2
return
運行后輸出結果是
a) 3 b) 12 c) 6 d) 9
(44) 有如下程序
a=30:b=30:c=120:d=120
cls
screen 1,0
line(a,b)-(c,d),1,bf
end
運行時屏幕上顯示
a) 一個矩形 b) 一條直線
c) 一個填滿了顏色的矩形塊 d) 無任何圖形
(45) common shared a!,b#語句定義的變量a及b是
a) 普通型和特別型的通用變量
b) 單精度實型和雙精度實型的全局變量
c) 單精度實型和雙精度實型的局部變量
d) 普通型和特別型的全局變量
(46) 有如下程序
declare function count(title)
input title
fee=count(title)
print fee
end
function count(title)
if title<40 then
pay=title/2
else
pay=10+title
end if
count=pay
end function
運行時從鍵盤輸入40,輸出結果是
a) 50 b) 20 c) 10 d) 顯示出錯信息
(47) 有如下程序
type goods
num as integer
num as integer * 13
end type
dim cloth as goods
該程序段定義了兩個程序成分,它們分別是
a) 記錄類型和記錄變量 b) 記錄類型和數(shù)組
c) 顯示類型和數(shù)組 d) 記錄變量和數(shù)組
(48) 有如下程序
open “student.dat” for output as #1
read num,nam$,sex$,score
do until nam$=“end”
write #1,num,nam$,sex$,score
read num,nam$,sex$,score
loop
data 101,li,m,90,103,wang,f,98
data 104,xiu,f,100,105,zhang,m,78
data 000,end,,
close
end
運行后,在文件student.dat中寫入的記錄共有
a) 3個 b) 4個 c) 5個 d) 6個
(49) 以下程序的功能是由鍵盤輸入10個數(shù),然后將此10個數(shù)從小到大排序,并將排序后的10個數(shù)顯示在屏幕上。但程序不完整,須在【49】處將程序補充完整。
dim a(10)
for j=1 to 10
input a(j):print a(j);
next j:print
for i=1 to 9
for j=i+1 to 10
if a(j)next j
next j
for j=1 to 10
print a(j);
next j
print
end
【49】處的內(nèi)容可在如下四項中選擇一項
a) a(j)= a(j) b) change a(j), a(j)
c) swap i,j d) swap a(ij), a(j)
(50) 有如下程序
open “goods.dat”for input as #1
n=1
do until eof(1)
input #1,no,part$,place$,price
print no, part$,place$,price
n=n+1
if n=5 then exit do
loop
close
end
在數(shù)據(jù)文件goods.dat中共有10個記錄,運行此程序后,實際從文件goods.dat中讀入的記錄有
a) 3個 b) 4個 c) 5個 d) 6個
二、填空題(每空2分,共40分)
請將每一個空的正確答案寫在答題卡【l】至【20】序號的橫線上,答在試卷上不得分。
(l)為了將當前盤當前目錄中的所有文本文件(擴展名為.txt)的內(nèi)容打印輸出,正確的單條dos命令為 【l】 。
(2)設當前盤為c盤。為了在a盤的當前自錄\user下建立一個新的子目錄x,正確的dos命令為 【2】 。
(3)在 xcopy、copy、time三個 dos命令中,屬于外部命令的是 【3】 。
(4)在32位的計算機中,一個字長等于【4】個字節(jié)。
(5)計算機網(wǎng)絡分為局域網(wǎng)和廣域網(wǎng),因特網(wǎng)屬于 【5】 。
(6)數(shù)學式 的qbasic表達式 【6】 。
(7)在qbasic程序中定義長度為10的字符串型變量ab的語句是 【7】 。
(8)表達式34 mod (1-3^3)的值為【8】 。
(9) 四個字符串“abc”、“average”及“access”中的最大者為【9】 。
(10) 下面程序運行后的輸出結果如下:
d
cd
bcd
abcd
但程序不完整,請在處【10】補充使之完整。
程序如下:
a$=“abcd”
for m=1 to 4
print 【10】
next m
end
(11) 下面一段程序定義了一個學生記錄,包括name、age及birthday三個域,其中birthday為字符型,格式為mm/dd/yyyy,但程序不完整,請在【11】處補充使之完整。
type student
nam as string*12
age as integer
birthday as 【11】
end type
(12) 下面程序運行后的輸出是【12】 。
k=1:m=5
for j=1 to m
k=k+j*j
next j
print k\m
end
(13) 下面的程序是從鍵盤輸入一個數(shù),在已知的數(shù)列中進行查找,未找到該數(shù)時返回-1,找到時返回該數(shù)在數(shù)列中的序號。查找在一個獨立模塊的函數(shù)中實現(xiàn)。請在【13】 、【14】 、【15】處將程序補充完整。
程序如下:
【13】 function srch(b(),a)
option base 1
dim shared b(50)
for j=1 to 50
b(j)=j
next j
input “enter a number to find:”;n
m=srch(b(),n)
if m<>-1 then
print “found at ”,m
else
print “not found”
end if
end
【14】 srch(b(),a)
for j=1 to 50
if b(j)=a then
srch=j
exit 【15】
else
srch=-1
end if
next j
end function
(14) 下面程序的作用是利用隨機函數(shù)產(chǎn)生100個100~200之間(包含100、200)的隨機函數(shù),打印其中17的整數(shù)倍的數(shù)及除去17的整數(shù)倍的數(shù)之外的其它數(shù)的總和。請根據(jù)程序的需要在【16】 、【17】 、【18】三處填上正確內(nèi)容。
randomize timer
s=0
for m=1 to 100
x=int(rnd*【16】):s=s+x
if 【17】 then
print x;
k1=k1+x
endif
next m
print
print “the sum=”; 【18】
end
(15) 下面程序的作用為判斷是否閏年(非閏年為不可被4整除,或能被100整除但不能被400整除的年份),請在【19】 、【20】 處補充使之完整。
程序如下:
input “year=”;y
if y mod 4<>0 then
【19】
elseif 【20】 then
leapyear=0
else
leapyear=1
endif
if leapyear=0 then
print “non-leap year!”
else
print “leap year!”
end if
end
2001年9月全國計算機等級考試二級筆試參考答案
qbasic
一、 選擇題((1)--(40)題每題1分,(41)--(50)題每題2分,共60分。
(01)b (02)a (03)c (04)d (05)c (06)a (07)b (08)d (09)a (10)c
(11)d (12)a (13)b (14)c (15)c (16)b (17)c (18)c (19)d (20)d
(21)d (22)b (23)b (24)d (25)d (26)a (27)b (28)a (29)a (30)c
(31)b (32)d (33)b (34)a (35)b (36)a (37)d (38)c (39)d (40)b
(41)c (42)d (43)b (44)c (45)b (46)d (47)a (48)b (49)d (50)b
二、填空題(每空2分,共40分)
1.copy *.txt prn
2.md a:x
3.xcopy
4.4
5.廣域網(wǎng)
6. sqr(exp(sin(x+y))*log(x-y))
7. dim ab as string*10
8.8
9.access
10.mid$(a$,5-m,m)
11.string*10
12.11
13.declare
14.function
15.for
16.101+100
17.x mod 17=0
18.s-k1
19.leapyear=0
20.(y mod 400 <>0) and (y mod 100=0)