文档详情

程序运行结果练习题.doc

发布:2018-04-19约4.71千字共3页下载文档
文本预览下载声明
程序运行结果 假设数据表文件成绩表中有“总分”字段,运行下列程序段 Use 成绩 X1=0 SCAN X1=MAX(总分,X1) Endscan ?X1 RETURN 执行该程序后X1显示的值为成绩表中的__________________________ clear do A return procedure A s=5 do B ?s Return Procedure B S=S+10 Return _______________________________ set talk off s=0 i=5 x=11 do while s=x s=s+1 i=i+1 enddo ?s Set talk on _____________________ 4有如下程序,函数iif( )返回值是_____ *程序 Private X,Y Stroe “男”to X Y=len(X)+2 ?iif(Y4,”男”,”女”) Return s=0 for n=100 to1 step -1 s=s+n endfor ?s Return ________________ clear set talk off store 1 to i,a,b do while i=3 do prog1 “p(“+str(I,1)+”)=”+str(A,2)+”,” i=i+1 enddo ??”b=”+str(b,2) Return Procdure prog1 a=a*2 b=b+a set talk on return ___________________ dime a(6) a(1)=1 a(2)=2 for i=3 to 6 a(i)=a(i-1)+a(i-2) next ?a(6) ____________________ accept to a if A=[123] s=o endif s=1 ?s _______________ clear store 0 to a,b,s,i,j do while i=5 i=i+1 if i=3 a=s j=i loop else s=s+i endif if i=4 b=s+a j=j+i exit else s=s+i endif enddo ?S ___________ main.prg set talk off a=5 b=”c” c=10 do p1 with b ?a,b,c set talk off return p1.prg parameters a b=”a” b=a Do p2 ?a,b,c Return p2.prg if c=b return to master else return endif 运行main.prg的结果为____________ 11、set talk off Dimension k(2,3) i=1 do while i=2 j=1 do while j=3 k(i,j)=i*j if int(k(i,j)/2)=k(i,j)/2 k(i,j)=k(i,j)+1 else k(i,j)=k(i,j)-1 endif ??k(i,j) ?? j=j+1 enddo ?i=i+1 Enddo Return _________________ 12、x=1 y=1 do while y6 x=x*y y=y+1 loop print x ______________ 13、m=1 Do while m5 n=1 ??m Do while n=m tt=n+m n=n+1 enddo ? m=m+1 enddo return ______________ 14、主程序 tt .prg Public a a=3 b=4 c=5 Do ss ?”2.a,b,c,d=”,a,b,cd Return 运行tt 的结果是______ *ss.prg Private c a=a+1 b=10 c=20 d=30 ?”1.a,b,c,d=”,a,b,c,d return 15、x=2 Do while x4 y=1 do while y4 if x*y5 ?x,y y=y+1 else exit endif enddo x=x+1 enddo return __________ 16、x=1 y=20 edo w
显示全部
相似文档