国开山东00035《VisualBasic程序设计》期末综合练习程序阅读分析题复习资料答案.docx
《国开山东00035《VisualBasic程序设计》期末综合练习程序阅读分析题复习资料答案.docx》由会员分享,可在线阅读,更多相关《国开山东00035《VisualBasic程序设计》期末综合练习程序阅读分析题复习资料答案.docx(22页珍藏版)》请在冰豆网上搜索。
国开山东00035《VisualBasic程序设计》期末综合练习程序阅读分析题复习资料答案
VisualBasic程序设计-期末综合练习(程序阅读分析题)作业资料答案
说明:
每学期的课程题目都可能更换,请认真核对是您需要的题目后再下载!
【题目】
privatesubform_click()
dimxasinteger
staticyasinteger
x=x+2
y=x+y
form1.print"x=";x,"y=";y
endsub
程序运行后三次单击窗体,form1上的输出结果为()。
A.x=2y=2
B.x=2y=4
C.x=2y=6
D.x=6y=6
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
x=2y=6
【题目】
privatesubcommand1_click()
dimxasinteger
staticsasinteger
x=val(inputbox("请输入一个正整数="))
ifx<5then
s=s*x
else
s=s+x
endif
text1.text="s="&str(s)
endsub
程序运行后,连续3次单击command按纽,且设输入的数据为5、4、3时,文本框text1中显示的值为()。
A.12
B.20
C.60
D.s=60
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
s=60
【题目】
privatesubcommand1_click()
staticxasinteger
staticyasinteger
cls
y=1
y=y+5
x=5+x
printx,y
endsub
程序运行后,单击命令按钮command1三次后,窗体上显示的结果为()。
A.1516
B.156
C.1515
D.56
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
156
【题目】
privatesubcommand1_click()
n=text1.text
selectcasen
case1to20
x=10
case2,4,6
x=20
caseis<10
x=30
case10
x=40
endselect
text2.text=x
endsub
程序运行后,如果在文本框text1中输入10,然后单击命令按钮,则在text2中显示的内容是()。
A.10
B.20
C.30
D.40
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
10
【题目】
privatesubcommand1_click()
staticyasinteger
cls
fori=0to2
x=x+y
y=y+3
nexti
printx,y
endsub
程序运行后,连续二次单击command1按钮后,窗体上显示的值是()。
A.99
B.3012
C.3618
D.6327
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
3618
【题目】
privatesubcommand1_click()
dimsasdouble
dimiasinteger
s=5
i=1
dowhilei<6
i=i+2
s=s+i
loop
text1.text=s
endsub
程序运行后,单击命令按钮,在文件框text1中的输出结果是()。
A.13
B.20
C.11
D.18
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
20
【题目】
privatesubcommand1_click()
x=0
dowhilex<60
x=(x+2)*(x+3)
n=n+1
loop
text1.text=str(n)
text2.text=str(x)
text3.text=val(text1.text)+val(text2.text)
endsub
程序运行后,单击命令按钮在文件框text3中显示的结果是()。
A.72
B.74
C.7
D.16
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
74
【题目】
privatesubcommand1_click()
staticsumasinteger
dimiasinteger
i=1
do
sum=sum+i
i=i+1
loopwhilei<=5
text1.text=sum
text2.text=i
endsub
程序运行后,两次单击command1按纽后,文本框text1.text2上的输出结果是()。
A.105
B.156
C.255
D.306
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
306
【题目】
privatesubcommand1_click()
staticxasinteger
cls
fori=1to2
y=y+x
x=x+2
nexti
printx,y
endsub
程序运行后,连续三次单击command1按钮后,窗体上显示的是()。
A.42
B.1218
C.1230
D.46
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
1218
【题目】
privatesubcommand1_click()
n=0
j=1
dountiln>2
n=n+1
j=j+n*(n+1)
loop
printn;j
endsub
程序运行后,单击命令按钮,在窗体上显示的值是()。
A.01
B.37
C.321
D.313
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
37
【题目】
privatesubcommand1_click()
p=0
s=0
do
p=p+2
s=s+p
loopwhilep<11
print"s=";s
endsub
程序运行后,单击命令按钮,在窗体上显示的值是()。
A.S=42
B.S=30
C.S=46
D.S=20
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
S=42
【题目】
privatesubcommand1_click()
x=0
dowhilex<50
x=(x+2)*(x+3)
n=n+1
loop
text1.text=str(n)
text2.text=str(x)
endsub
程序运行后,单击command1按钮,在两个文本框中显示的值分别为()。
A.10
B.272
C.350
D.4168
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
272
【题目】
privatesubcommand1_click()
x=1:
n=0
dowhilex<100
x=x*10
n=n+1
loop
text1.text=str(n)
text2.text=str(x)
endsub
程序运行后,单击命令按钮,在两个文本框中显示的值分别为()。
A.100
B.2100
C.350
D.4168
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
2100
【题目】
privatesubform_click()
fori=1to10step2
y=y+i
nexti
printi
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.25
B.10
C.11
D.9
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
11
【题目】
privatesubform_click()
i=0
forg=10to19step3
i=i+1
nextg
printi
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.4
B.5
C.3
D.6
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
4
【题目】
privatesubform_click()
dimcasinteger,jasinteger,kasinteger
k=1
c=2
forj=1to5
ifj>3then
c=c+5
exitfor
else
k=k+1
endif
nextj
printc,k
endsub
程序运行后,单击窗体,在窗体上显示的c,k的值分别是()。
A.73
B.74
C.24
D.75
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
74
【题目】
privatesubform_click()
dimiasinteger,jasinteger
dimcasinteger
c=0
fori=1to3
forj=1to2
c=c+3
nextj
nexti
printc
endsub
程序运行后,单击窗体,在窗体上显示的结果是()。
A.18
B.15
C.12
D.9
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
18
【题目】
privatesubform_click()
dimiasinteger,kasinteger,casinteger
fori=1to5
ifimod2=0then
k=k+2
else
c=c+3
endif
nexti
printk,c
endsub
程序运行后单击窗体,form1上的输出结果是()。
A.212
B.49
C.46
D.29
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
49
【题目】
privatesubcommand1_click()
dimiasinteger,nasinteger
fori=0to50
i=i+3
n=n+1
ifi>10thenexitfor
nexti
text1.text=str(n)
endsub
程序运行后,单击命令按钮,在文本框中显示的值是()。
A.2
B.3
C.4
D.5
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
3
【题目】
privatesubform_click()
dimiasinteger,kasinteger,casinteger
fori=1to10
ifimod2=0then
k=k+3
else
c=c+4
endif
nexti
printk,c
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.1020
B.2015
C.1520
D.1030
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
1520
【题目】
privatesubform_click()
dimcasinteger,jasinteger,kasinteger
k=1
c=2
forj=1to5
ifj>3then
c=c+6
exitfor
else
k=k+3
endif
nextj
printc,k
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.108
B.810
C.87
D.84
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
810
【题目】
privatesubform_click()
dimiasinteger,kasinteger
staticcasinteger
fori=1to6
ifimod2=0then
k=k+2
else
c=c+3
endif
nexti
printk,c
endsub
程序运行后,连续两次单击窗体,在窗体上显示的值是()。
A.612
B.624
C.69
D.618
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
618
【题目】
privatesubform_click()
b=1
dowhileb<40
b=b*(b+1)
loop
printb
endsub
程序运行后,单击窗体,在窗体上显示的值为()。
A.42
B.39
C.6
D.1
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
42
【题目】
privatesubform_click()
dima(1to3)asstring
dimcasinteger
dimjasinteger
a
(1)="3"
a
(2)="6"
a(3)="9"
c=1
forj=1to3
c=c+val(a(j))
nextj
printc
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.10
B.19
C.16
D.17
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
19
【题目】
privatesubcommand1_click()
dima(1to5)asinteger
dimxasinteger
fori=1to5
a(i)=i
nexti
i=1
dowhilex<6
a(i)=a(i)+x
x=x+2
i=i+2
loop
text1.text=a(3)
text2.text=a(5)
endsub
程序运行后,单击命令按钮,在两个文本框中显示的值是()。
A.59
B.54
C.95
D.45
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
59
【题目】
privatesubcommand1_click()
dima(1to5)asinteger
dimxasinteger
fori=1to5
a(i)=i
nexti
i=1
dowhilex<2
a(i)=a(i)*x
x=x+1
i=i+1
loop
text1.text=a
(1)
text2.text=a
(2)
endsub
程序运行后,单击command1后按钮,文件框text1、text2中的结果是()。
A.20
B.02
C.24
D.25
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
02
【题目】
privatesubcommand1_click()
dimm(5)
fori=1to5
m(i)=i*i
nexti
printm(i-1)
endsub
程序运行后,单击命令按钮,在窗体上显示的值是()。
A.5
B.25
C.05
D.16
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
25
【题目】
subchange(xasinteger,yasinteger)
dimtasinteger
t=x
x=y
y=t
printx,y
endsub
privatesubform_click()
dimaasinteger,basinteger
a=30:
b=40
changea,b
printa,b
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.3040
3040
B.3040
4030
C.4030
4030
D.4030
3040
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
4030
4030
【题目】
subtest(iasinteger)
i=i+4
endsub
privatesubform_click()
dimxasinteger
x=5
print"x=";x
calltest(x)
print"x=";x
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.x=5x=9
B.x=9x=5
C.x=5
x=9
D.95
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
x=5
x=9
【题目】
functionf(aasinteger)
dimbasinteger
staticcasinteger
b=b+2
c=c+3
f=a+b+c
endfunction
privatesubcommand1_click()
dimaasinteger
a=4
fori=1to3
printf(a);
nexti
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.999
B.91215
C.91419
D.91113
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
91215
【题目】
privatesubform_click()
dimx,yasinteger
x=5:
y=10
ncx,y
printx,y
endsub
privatesubnc(byvala%,b%)
a=a+b
b=a
a=a*b
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.515
B.1515
C.22515
D.510
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
515
【题目】
subabcd(byvalnasinteger)
n=n+5
endsub
privatesubform_click()
nx%=3
callabcd(nx%)
printnx%
endsub
程序运行后,单击窗体,在窗体上显示的值是()。
A.5
B.3
C.9
D.10
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
3
【题目】
dimyasinteger
privatesubform_click()
dimxasinteger
x=1
y=2
callaa(y+1)
z=bb(x)
printx,y,z
endsub
publicsubaa(byvalzasinteger)
y=z+x
z=x+y
endsub
publicfunctionbb(byrefyasinteger)
y=y+1
bb=x+y
endfunction
程序运行后,单击窗体,在窗体上显示的值是()。
A.222
B.232
C.323
D.233
[请认真阅读以上题目,运用所学知识完成作答]
参考答案:
232