最近中文字幕完整版高清,宅男宅女精品国产av天堂,亚洲欧美日韩综合一区二区,最新色国产精品精品视频,中文字幕日韩欧美就去鲁

首頁 > 考試輔導(dǎo) > 計算機考試 > 計算機等級考試 > 試題集錦 > 2003年4月全國計算機等級考試二級QBASIC語言程序設(shè)計

2003年4月全國計算機等級考試二級QBASIC語言程序設(shè)計

一、選擇題((1)-(40)每小題1分,(41)-(50)每小題2 分,共60分)
下列各題 a) 、b)、c) 、d)四個選項中,只有一個選項是正確的,請將正確選項涂寫在
答題卡相應(yīng)位置上,答在試卷上不得分。
(1) 用8位無符號二進制數(shù)能表示的最大十進制數(shù)為
a) 127 b) 128 c) 255 d) 256

(2) 在64位高檔微機中,一個字長所占的二進制位數(shù)為
a) 8 b) 16 c) 32 d) 64

(3) 在windows環(huán)境下,為了復(fù)制一個對象,在用鼠標(biāo)拖動該對象時應(yīng)同時按住
a) alt鍵 b)esc鍵 c)shift鍵 d)ctrl鍵

(4) 在windows菜單中,暗淡(灰色)的命令項表示該命令
a) 暫時不能用 b) 正 在執(zhí)行 c) 包含下一層菜單 d) 包含對話框

(5) 在dos環(huán)境下,為了得到type命令的幫助信息,正確的dos命令為
a) type b) type/h c) type/* d) type/?

(6) 下列選項中,能作為合法dos文件名的是
a) anp/a.dat b) abccom c) ecd.basic d) xy+z.txt

(7) 下列敘述中正確的是
a) 在windows環(huán)境下,最大化的窗口是不能移動的
b) 在windows環(huán)境下,應(yīng)用程序窗口最小化后,該應(yīng)用程序暫停執(zhí)行
c) 在windows環(huán)境下,只有最小化的窗口才能關(guān)閉
d) 在windows環(huán)境下,不能關(guān)閉最大化的窗口

(8) 在windows環(huán)境下,工具欄中的復(fù)制按鈕是
a) 打印機圖標(biāo) b)剪刀標(biāo)志 c) 復(fù)制標(biāo)志 d) 粘貼標(biāo)志

(9) 在windows98環(huán)境下,若要將整個屏幕上顯示的內(nèi)容存入剪貼板,可以按
a) ctrl+printscreen鍵 b) alt+printscree鍵
c) shift+printscreen鍵 d) printscreen鍵

(10) 目前,計算機病毒擴散最快的途徑是
a) 通過軟件復(fù)制 b) 通過網(wǎng)絡(luò)傳播
c) 通過磁盤考貝 d) 運行游戲軟件

(11) 在qbasic集成開發(fā)環(huán)境中,在編輯源程序后要運行程序,應(yīng)按下鍵盤上的
a) f2鍵 b) f5鍵 c) enter鍵 d) end鍵

(12) 關(guān)于qbasic源程序語句中行號的說法正確的是
a) 必須有行號 b) 不允許有行號 c) 根據(jù)需要可有可無 d) 只允許有標(biāo)號

(13) 在qbasic中,常量3e1的數(shù)據(jù)類型是
a) 字符串 b) 單精度實型 c) 雙精度實型 d) 整型

(14) 在下列四個式子中,非法的qbasic表達(dá)式是
a) a=abc b) 5>3+3 c) a+b=c d) 5<>5

(15) qbasic表達(dá)式3^3/3mod2的值是
a) 1 b) -1 c) 3 d) 0

(16) 在以下屬于合法的qbasic變量名是
a) x-3 b) 4y c) n$1 d) b.1

(17) 定義一個3×3的二維數(shù)組,正確的語句是
a) dim a(0 to 3,0 to 3) b)dim a(2000 to 2002,0 to 2)
c) dim a(3),a(3) d)dim a(1 to 3)

(18) 下列語句中合法的是
a) print a=atn b) print"sin(3.14)"+"cos(3.14"
c) print tab(10) "qb" d) print using"####",1234.56

(19) 在qbasic中,下列運算符優(yōu)先級最高的是
a) mod b) not c) / d) ^

(20) 正確的單行自定義函數(shù)語句是
a) def fn(x)=3.14159^2 b) define fn(x)=3.14129^2
c) def fnn(x)=3.14159^2 d) def fnn(x)=3.14159^2 end

(21) 表達(dá)式int(4*rnd+1)*(int(4*rnd-1))值的范圍是
a) [0,8] b) [-1,8] c) [-3,8] d)[-4,8]

(22) 有如下程序段
const c="wang"
  c$="a"
  print len(c);len(c$)
  其輸出結(jié)果為
a) wang a b) 4 1 c) 1 1 d) 重復(fù)定義,程序出錯

(23) 有如下程序段
a%=12.8:b!=14.5
  print a%,b!
  其輸出結(jié)果為
a) 12.8 4 b) 12 1 4.5 c) 12.8 15 d) 13 1 4.5

(24) 有如下程序
read a,b,c
  restore k
  read c,c,d
  data 1,2
  k: data 3,4,5
  print a;b;c;d
  end
a) 1 2 3 4 b) 1 2 3 5 c) 3 4 5 4 d) 1 2 4 5

(25) 以下語句中錯誤的是
a) input"x,y=";a,b b) input"x,y=",c,d
c) input, "x,y=",e,f d) input; "x,y=",g,h

(26) 實現(xiàn)選擇結(jié)構(gòu)"如果x確程序段為
a) if x
b) if x>=y then
a=-15 a=-15
  print a else a=15
  end if end if
  print a
c) if x>y then a=-15
d) if x>=y then go to d
  a=15 a=15
  print a d: a=-15
  end print a
  end

(27) 以下語句中正確的是
a) for 1 to 10 step 2 b) for x=1,9 step3
c) for x=10 to-10 step-10 d) for x=10 to 50 next

(28) 有如下程序
  dim k as integer, y as integer
  let y=3
  for k=1 to 5 step-1
  y=y+k
  next k
  print y;k
  end
  其輸出結(jié)為
a) 3 1 b) 4 0 c) -1 6 d) 4 1

(29) 有如下程序
  dim x as integer, y as integer
  for x=1 to 2
  for y=0 to x=-1
  print y
  next y
  next x
  end
  內(nèi)層循環(huán)的循環(huán)體的總執(zhí)行次數(shù)是
a) 1 b) 2 c) 3 d) 4

(30) 有如下程序
  dim x as integer, y as integer
  x=0
  read y
  while y<>-9999 and x<>3
  if y>x then x=y
  read y
  wend
  data-9999,9,8,3,9999
  print abs(y)
  end
  運行后的輸出結(jié)果為
a) 9 b) -9999 c) 3 d) 9999

(31) 有如下程序
  a$="12"
  b$="24"
  c$=b$+a$
  d=val(c$)
  print d100
  end
  運行后的輸出結(jié)果是
a) 12 b) 36 c)34 d) 24

(32) 有如下程序
  for j=1 to 5
  a=(a+j)mod 5
  next j
  print a
  end
  運行后的輸出結(jié)果是
a) 0 b) 5 c) 25 d) 50

(33) 當(dāng)eof()函數(shù)返回的值為-1時,表示文件指針指向文件的
a) 開頭 b) 第一個記錄 c) 末尾 d) 最后一個記錄

(34) 有如下程序
  for x=1 to 4
  z=0
  for y=1 to x+2
  z=z+1
  next y
  print z;
  next x
  end
  運行后的輸出結(jié)果是
a) 3 4 5 6 b) 4 5 6 7 c) 5 6 7 8 d) 6 7 8 9

(35) 有如下程序
  def fna(x,y)=x^2+y^2
  x=4
  y=3
  print fna(x,y)
  end
  運行后的輸出結(jié)果是
a) 5 b)7 c)25 d)49

(36) 有如下程序
  m$="abcde"
  mid$(m$,1,5)= "abcde"
  print m$
  end
  運行后的輸出結(jié)果是
a) abcdeabcde b) abcdeabcde c) abcde d) abcde

(37) 有如下程序
  for j=1 to 10
  read a
  if a mod 2=0 then sum=sum+a
  next j
  print"sum=";sum
  data 1,3,6,10,15,21,28,36,45,55
  end
  運行后的輸出結(jié)果是
a) 55 b) 80 c) 140 d) 220

(38) 有如下程序
  x=1
  do
  x=2+1
  num=num+1
  loop until x>100
  print num,x
  end
  運行后的輸出的結(jié)果是
a) 6 127 b)8 127 c)127 8 d)127 8

(39) 有如下程序
  sum=0
  for i=1 to 9
  if i<>10 then
  sum=sum+1
  else
  sum=sum+2
  end if
  next i

(40) 有如下程序
  m$="*"
  i=1
  for k=3 to 1 step -1
  x$=string$(k+i,m$)
  print x$
  m$=m$+"*"
  i=-i
  next k
  end
  運行后的輸出結(jié)果是

a)
 
     
b)
   
   
c)
    *
   
d)
   
   

(41) 有如下程序
  declare sub f(m%,n%,g%)
  call f(87,69,g%)
  print g%
  end
  sum f(m%,n%,g%)
  a=m%
  b=n%
  do
  c=a mod b
  a=b
  b=c
  loop while c<>0
  g%=a
  end sub
  運行后的輸出結(jié)果是
a) 3 b) 18 c) 69 d)87

(42) 有如下程序
  input n
  i=2
  t=-1
  do while i*i<=n
  if n mod i=0 then
  t=0
  end if
  i=i+1
  loop
  print t
  end
  運行時輸入257,輸出結(jié)果是
a) 0 b) 1 c) -1 d) 257

(43) 有如下程序
  month=int(rnd*3+1)+6
  select cass month
  case 1 to 3
  season$="first"
  case 4 to 6
  season$="second"
  case 7 to 9
  season$="third"
  case else
  season$="fourth"
  end select
  print season$
  end
  運行后的輸出結(jié)果是
a) first b)second c)thire d)不能確定

(44) 有如下程序
  declare function f(n)
  input n
  print f(n)
  end
  function f(n)
  if n=0 then f=0 else f=n+f(n-1)
  end function
  鍵盤輸入n運行后的輸出結(jié)果是78,則n的值是
a) 10 b)11 c)12 d)13

(45) 有如下程序
  cls:screen 13:color 2
  x=180:y=100:r=50
  circle(x,y),50
  circle(180,100),r
  end
  該程序在屏幕上顯示的是
a) 一個圓 b) 兩個同心圓 c) 兩個不同心的圓 d) 沒有顯示

(46) 有如下程序
  screen 13
  color 2
  line(10,10)-(50,50)
  line(50,50)-(10,90)
  end
  程序所畫兩條線段
a) 關(guān)于一點對稱 b) 關(guān)于一條垂直的直線對稱
c) 關(guān)于一條水平的直線對稱 d) 重合

(47) 有如下程序
  for m=3 to 5
  for j=1 to m-2
  for k=j to 3
  n=n+k
  next k
  next j
  next m
  end
  運行后n的值為
a) 21 b) 25 c) 31 d) 42

(48) 有如下程序
  m$="a"
  n$="b"
  o$=lcase$(m$)
  p$=ucase$(n$)
  end
  運行結(jié)果是
a) a 0 b 0 b) a 0 b0 c) a 97 b 66 d) a 65 b 98

(49) 語句open"a.dat"for random as#1 len=30表示此文件每個記錄
a)長度等于30個字符 b)長度等于30個字節(jié)
c)長度小于或等于30個字節(jié) d)長度小于或等于30個字符

(50) 有如下程序
  dim x(3,3)
  for k=1 to 2
  for j=1 to 2
  if k=j then
  x(k,j)=1
  else
  x(k,j)=0
  end if
  next j:next k
  open"diagonal.dat"for output as#1
  for k=1 to 2
  print#1,x(k,1);x(k,2)
  next k
  close#1
  end
  執(zhí)行程序,屏幕上顯示的結(jié)果是
a) 0 1
1 0
b) 1 0
0 1
c) 0 0
1 1
d) 沒有任何顯示

二、填空題(每空2分,共20分)
請將每空的正確答案寫在答題卡上【1】-【10】序號的橫線上,答在試卷上不得分。
(1) 用十六進制給存儲器中的字節(jié)地址進行編號,若地址編號從000到ffff,則該存諸器的容量為【1】kb。

(2) 假設(shè)在當(dāng)前盤的當(dāng)前目錄下有兩個文件a.txt和b.txt,現(xiàn)要將文件b.txt合并連接到文件a.txt的后面。若使用copy命令,則完整的命令為【2】。

(3) e-mail地址由用戶名和域名兩部分組成,這兩部分的分隔符為【3】。

(4) 假設(shè)在當(dāng)前盤當(dāng)前目錄下有一個可執(zhí)行程序user.ext,F(xiàn)要執(zhí)行該程序,并要求在執(zhí)行過程中將顯示輸出的結(jié)果信息存入當(dāng)為【4】。

(5) 在dos環(huán)境下,表示打印機的設(shè)備文件名為【5】。

(6) 數(shù)據(jù)式aeutcos(wt+v)的qbasic表達(dá)式為【6】。

(7) 常數(shù)-0.00013579的標(biāo)準(zhǔn)化的指數(shù)形式是【7】。

(8) 有如下程序
  a=1357:b=246
  c=len(str$(a)+str$(b))
  print c
  end
  運行后,輸出的值是【8】。

(9) 四個字符串"xab"、xyz"、"def"及"de"中最大者為【9】。

(10) 有如下程序
  for j=1 to 11
  j=j+1
  if j mod 4=0 then n=n+1
  next j
  print"n=";n
  end
  運行后,輸出的值是【10】。

(11) 有如下程序
  x=5:y=-20
  if not x>0 then
  x=y-3
  else
  y=y+3
  end if
  print x-y;y-x
  end
  運行后的輸出結(jié)果是【11】。

(12) 設(shè)a=2,b=3,c=4,d=5,表達(dá)式3>2*b or a=c and b<>c or c>d的值是【12】。

(13) 有如下程序
  for i=1 to 5
  for x=i to 5 step 1
  if i=2 and x<5 then print"*";
  next x
  next i
  end
  運行后輸出的結(jié)果是【13】。

(14) 隨機生成100個-500到500間的整數(shù)(含-500和500),并找出其中第k大的數(shù)。請在【14】、【15】處填入適當(dāng)內(nèi)容將程序補充完整。
dim a(100)
  input k
  for i=1 to 100
  a(i)=int(【14】*rnd)-500:print a(i);
  next i
  print
  for i=1 to k
  for j=i+1 to 100
  if【15】then swap a(i),a(j)
  next j
  next i
  print"a(";k;")=";a(k);
  end

(15) 有如下程序
  dim i as integer,x as integer
  x=1:y=1:i=1
  do while i<4
  f=x+y
  x=y
  y=f
  print f
  i=i+1
  loop
  end
  運行后的輸出的結(jié)果是【16】。

(16) 有如下程序
  dim tel(10)as string*8
  for i=1 to 4
  read tel(i)
  next i
  for i=1 to 4
  if left$(tel(i),1)="2"then
  tel(i)="6"+tel(i)
  else
  tel(i)=tel(i)+"9"
  end if
  next i
  print tel(1),tel(2)
  data 6543210,2345678,2457788,8237777
  end
  運行后輸出的結(jié)果是【17】。

(17) 下面的程序從鍵盤輸入一個正整數(shù)n,計算并輸出比n小,并且與n互素的數(shù)的個數(shù)。(兩個數(shù)互素是指它們的最大公約數(shù)等于1)
declare function gcd(a,b)
  input n
  phi=1
  for i=2 to n-1
  if gcd(n,i)=1 then phi=【18】
  next i
  end
  function gcd(a,b)
  if b=0 then
  tmp=【19】
  else
  if b=1 then tmp=1 else tmp=共產(chǎn)黨(b, 【20】)
  endif
  gd=tmp
  end function
  運行后,輸出的值是