vfp程序设计测试1111.docx
- 文档编号:15431280
- 上传时间:2023-07-04
- 格式:DOCX
- 页数:17
- 大小:17KB
vfp程序设计测试1111.docx
《vfp程序设计测试1111.docx》由会员分享,可在线阅读,更多相关《vfp程序设计测试1111.docx(17页珍藏版)》请在冰点文库上搜索。
vfp程序设计测试1111
VFP程序设计测试
一、选择题
1、顺序执行下列命令:
a=10
b=20
c=30
?
c=a+b
最后一条命令显示的结果是(A)逻辑真
a、tb、fc、30d、a+b
2、在下列命令中,正确的命令是()
a、x=y=10b、x=100,y=100
c、store100tox,y
d、store100,100tox,y
3、设a的值为5,执行?
a=a+1命令后显示的结果是(A)逻辑假
a、fb、tc、5d、6
4、设x=100,y=200,g=“x+y”,表达式5+&g的值是()
a、305b、503
c、300d、5+“x+y”
5、建立命令文件abc.prg的命令是()
a、useabc.prgb、modicommabc
c、modistructrueabc.prg
d、modiabc.prg
6、当程序输入或修改完毕,可按()键存盘保存程序文件。
a、ctrl+nb、crtl+y
c、ctrl+wd、crtl+q
7、在程序中执行命令()将返回到windows操作系统。
a、returnb、cancel
c、quitd、exit
8、在下列循环中,一共要循环()次包括第一次
a、15b、10c、6d、5
x=10
y=15
dowhiley>=x
y=y-1
enddo
9、有以下程序段:
a=85
b=val(substr(“7199009”,at(“7”,“647791”),3))
c=1500
m=0
ifa>banda>=c
m=a
else
ifb>=aandb>=c
m=b
else
m=c
endif
endif
?
m
程序中的?
命令输出变量m的值是()
a、1500b、85c、990d、900
10、下列程序的运行结果是()
dimensiona(6)
fork=1to6
a(k)=30-3*k
endfor
k=5
dowhilek>=1
a(k)=a(k)-a(k+1)
k=k-1
enddo
?
a
(2),a(4),a(6)
a、121518b、181215
c、181512d、151812
11、下列程序的运行结果是()
store0tox,y
dowhilex<20
x=x+y
y=y+2
enddo
?
x,y
a、2010b、1020
c、2022d、2220
二、程序阅读题
11、下列程序的运行结果是__________
n=1
s=0
dowhilen<=10
s=s+n*n
n=n+1
enddo
?
“s=”,s
12、下列程序的运行结果是________
store2toa,b
dowhilea<15
a=a+b
b=b+2
enddo
?
a,b
13、下列程序的运行结果是________.f.–48
dimensions(6)
x=2
dowhilex<=6
s(x)=20-2*x
x=x+1
enddo
x=5
dowhilex>=2
s(x)=s(x)/(s(4)-10)
x=x-1
enddo
?
s
(1),s
(2),s(6)
14、以下程序的运行结果是___________
1234
2468
36912
dimes(3,4)
m=1
dowhilem<=3
n=1
dowhilen<=4
s(m,n)=m*n
?
?
s(m,n)
n=n+1
enddo
?
m=m+1
enddo
15、下列程序的运行结果是_______
23
24
25
store0toa
dowhilea<3
b=3
dowhileb<6
ifa*b>5
?
a,b
b=b+1
loop
else
exit
endif
enddo
a=a+1
enddo
16、下列程序的运行结果是______5.15
store0tox,y
dowhile.t.
x=x+1
y=y+x
ifx>=5
exit
endif
enddo
?
x,y
17、下列程序的运行结果是___________s=30
s=0
n=10
k=1
dowhilek<=10
ifint(k/2)=k/2
s=s+k
endif
k=k+1
enddo
?
“s=”,s
18、下列程序的运行结果是___________h=245
g=10
k=1
dowhile.t.
h=g*k^2/2
ifh>200
exit
endif
k=k+1
enddo
?
“h=”,h
19、下列程序的运行结果是___________6s=18
i=1
s=0
dowhilei<=3
sub=0
j=1
dowhilej<=3
sub=sub+j
j=j+1
enddo
s=s+sub
i=i+1
enddo
?
“s=”,s
20、若输入499时,程序的运行结果是___490.9–29
x=-1
input“n=”ton
dowhilen>0
ifn/2<>int(n/2)
x=x+10
else
x=x-5
endif
n=n-x
enddo
?
n,x
21、下列程序的运行结果是___________930.1149
x=3
y=0
t=x
f=1
fori=1to15
f=f*i
t=t*x/f
y=y+t
endfor
?
y
22、下列程序的运行结果是___________
1*1=1
2*1=2
3*1=3
4*1=4
5*1=5
6*1=6
7*1=7
8*1=8
9*1=9
store1toa,b
dowhilea<10
x=a*b
?
str(a,10)+”*”+str(b,1)+”=”
?
?
x
a=a+1
enddo
23、下列程序的运行结果是___________55
s=0
n=1
dowhilen<=10
s=s+n
n=n+1
enddo
?
s
24、下列程序的运行结果是___________21.204120
store1ton
store20tom
dowhilen<=m
ifn%2=0
n=1+n*m
loop
else
n=n+1
endif
enddo
?
n,m
25、下列程序的运行结果是___________606
s=0
fori=50to100
ifi%2=1and(i%5=0ori%7=0)
s=s+i
endif
endfor
?
s
26、若x=4,下列程序的运行结果是_____17
inputtox
ifx**2=6
y=x
endif
ifx**2<15
y=1/x
endif
ifx^2>15
y=x^2+1
endif
?
y
27、下列程序的运行结果是______78+
store0ton,s
dowhile.t.
n=n+1
s=s+n
ifn>11
exit
endif
enddo
?
“s=”+str(s,2)
28、当输入90时,程序的运行结果是____a
input“x=”tox
m=int(x/10)
docase
casem=9
?
“a”
casem=8
?
“b”
casem=7
?
“c”
otherwise
?
“d”
endcase
29、下列程序的运行结果是___________51502600
i=1
sum=0
dowhilei<=100
i=i+2
sum=sum+i
enddo
?
sum
30、下列程序的运行结果是___________0
s=0
i=1
dowhilei<100000
s=s*i
i=i+1
enddo
?
s
31、下列程序的运行结果是___________1死循环
i=1
s=1
dowhilei<10无解除循环的条件
s=s*i
enddo
?
s
32、下列程序的运行结果是___________n小于等于8
n=2^3-8
ifn>0
?
”n大于8”
else
?
”n小于等于8”
endif
33、下列程序的运行结果是__________-12
i=0
s=1
dowhilei<=10
s=s+(-1)^i
i=i+1
enddo
?
s
34、下列程序的运行结果是___________0
i=1
sum=0
dowhilei<=100
i=i+3
exit
enddo
?
sum
35、下列程序的运行结果是___________50005050
i=1
s=0
dowhilei<=100
s=s+i
i=i+1
enddo
?
s
36、下列程序的运行结果是___________2.1
a=1
b=2
t=a
a=b
b=t
?
a,b
37、下列程序的运行结果是___________315945
i=1
s=1
dowhilei<10
s=s*i
i=i+2
enddo
?
s
38、下列程序的运行结果是___________178175
i=1
sum=0
dowhilei<=40
i=i+6
sum=sum+i
enddo
?
sum
39、下列程序的运行结果是___________.t.
f=.t.
s=0
i=1
dowhilei<=10
s=s+i
i=i+1
iff=.f.
exit
endif
enddo
?
f
40、下列程序的运行结果是___________12855
a1=1
a2=1
fori=3to10
a3=a1+a2
a1=a2
a2=a3
endfor
?
a3
参考答案
一.选择题:
acaabcccaca
二.程序阅读题:
11、s=385
12、2210
13、.f.–48
14、1234
2468
36912
15、23
24
25
16、515
17、s=30
18、h=245
19、s=18
20、–29
21、30.1149
22、1*1=1
2*1=2
3*1=3
4*1=4
5*1=5
6*1=6
7*1=7
8*1=8
9*1=9
23、55
24、4120
25、606
26、17
27、s=78
28、a
29、2600
30、0
31、死循环
32、n小于等于8
33、2
34、0
35、5050
36、21
37、945
38、175
39、.t.
40、55
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- vfp 程序设计 测试 1111