大一的vb期末考试题和答案.docx
- 文档编号:9199717
- 上传时间:2023-05-17
- 格式:DOCX
- 页数:14
- 大小:19.44KB
大一的vb期末考试题和答案.docx
《大一的vb期末考试题和答案.docx》由会员分享,可在线阅读,更多相关《大一的vb期末考试题和答案.docx(14页珍藏版)》请在冰点文库上搜索。
大一的vb期末考试题和答案
大一的vb期末考试题和答案(FreshmanVBfinalexamquestionsandanswers)
[transfer]aVBfinalexamquestionsandanswerssharecopylogaddressaddress:
PleaseuseCtrl+Ctocopypastetoafriend.
ReprintedfromhelloOx20110513August10:
02(0)readingcomments(0)category:
personaldiary:
OpenAccess
Font:
bigsosmallinthebigsizesettopmorepermissionstodeletetheloglogrecommendedprivateeditor
1.inthecodereferstoacontrol,shouldbeusedtocontrol(b)attributes.
A.CaptionB.NameC.TextD.Index
2.variablex=4,y=-1,a=7,B=-8(a),theexpressionvalueis"false".
A.x+aB-YB.x
C.a=BORx>yD.x+ya+bAND>NOT(y
3.theexpressionofInt(Rnd*71)randomintegerrangefrom+10are(C).
A.(10,80)B.(10,81)C.[10,80],D.[10,81]
4.functionSgn(3.1416)returnvalue(C).
A.-1B.0C.1D.isrightabove
5.67890(d)belongstothetypeofdata.
A.integerB.singleprecisionfloating-pointnumberC.currencyD.longinteger
Thefollowing6.variablesaretrue(D).
A.3SB.PrintC.SelectMyNameD.Select_1
7.thefollowingassignmentstatement(a)iseffective.
A.sum=sum-sumB.x+2=x+2C.x+y=sumD.last=Y/0
Thecontrolmethodorbelow8.withinputandoutputfunctionsfor(B).
A.PrintB.TextboxC.OptionbuttonD.Checkbox
9.tobechosenforthelistboxlistitems,canaccess(d)propertytoimplement.
A.NameB.ListIndexC.ListCountD.Text
10.thefollowingcodeoperationresults(B).
PrivateSub(command1_click)
Dimm(10)
Fork=1To10
M(k)=11-K
NextK
X=5
Printm(2+m(x))
EndSub
A.2B.3C.4D.5
Two,fillintheblanks(10points)
Write1.integerncanbedivisibleby13and17BasicnMod13=0AndnModexpression17=0.
2.inthecodewindowhastwodrop-downlistbox:
ontheleftisthelistbox,listboxisontherightsideoftheprocess.
3.writeinthestring"VisualBasic6.
TheexpressionofBasicin0"intercept"Visual".
4.functionLen("ABCDEF")isthereturnvalueofthe.
5.a=2,B=5,C=-2,d=100,a>b>=CANDa=Dvalue.
6.tomakethesizeoftagautomaticallyadaptswithtextdisplay,cansetthepropertiesfortheTruetoachieve.
7.inarowtowritemultiplestatements,eachstatementshouldbeaddedbetweentheseparatorseparatestheVisualBasicstatementforfu.
8.toforceexplicitdeclarationofvariables,theuseof__________statementcompletion.
9.inVB,auser-definedconstantsusingstatementsdeclarevariablesusingstatements.
Three,thefollowingmathematicalexpressionintoVBexpression.(6points)
1.a2+2ab+b2__________________________
2.__________________________
3.8exln10__________________________
4.2sin(450)cos(450)_______________________________
5.___________________________________________
6.___________________________________________
Four,todeterminetheproblem,correcttick,error"X"(10points)
InVB1.,theeventcanonlybetriggeredbyauseroperation.()
2.characterdataindoublequotesasadelimiter,outputdoublequotesitselfwillnotbedisplayedonthescreen.()
3.saveproject,formfilesandprojectfilenamecannotbethesame.()
4.changethesizeofthecontrol,youcanusethemouseandkeyboard,canalsomodifythecode.()
5.thesameprocess,andanarrayofsimplevariablecanhavethesamename.()
Theparametersinthe6.VBfunctioncanbeaconstant,variable,expression,canalsobeanotherfunction.()
7.ConstNumber1=15:
Number1=10legalcode.()
8.allowallofblockstructureintheIf-Thenstatementarewrittenononeline()
9.definitionstatementDim(b)aAsInteger(right)
10.duringthecall,"theargumentlist"and"parameterlist"inthecorrespondingvariablenamedoesnothavetobethesame,butthenumberofvariablesmustbeequal,andthetypeoftheactualparametermustbethetypewiththecorrespondingformalparameters.()
Five,accordingtotheproblem,willcompletethefollowingprocedures.(16points)
1.randomintegerbetween20[10100],eachlineofoutputdata10.
PrivateSub(command1_click)
Dima(1To20)AsInteger
Randomize
I=0
DoWhileI<20
I=I+1
A(I)=()
If(Then)
Printa(I);
endif
ifi=10,thenprinta(i).
ifi>10thenprinta(i);
loop
endsub
2.打印九九乘法表
privatesubcommand1_click()
fori=1to9.
forj=1to9.
print()
nexti
(a)
endsub
3.判断一个数是否素数
privatesubcommand1_click()
x=inputbox(请输入一个整数)
flag=1
fori=1to()
ifxmodi=0then
flag=0
endif
nexti
if(),thenprintxxxxxxxxxxxxxx"是素数"elseprint"不是素数";
endsub
4.利用数组输出fibonacci数列的前15项.
该数列的第1项和第2项为1,其余各项均为其前两项之和.
privatesubcommand1_click()
(a)
f
(1)=1,f
(2)=1.
list1.additemf
(1)f
(2)list1.additem
for(i=3to15.
f(i)=().
list1.additemf(i).
nexti
endsub
六、写出下面程序的输出结果(每题3分,共18分).
1.privatesubcommand1_click()
x=inputbox("enterxxxxxxxxxxxxxx的输入值为(8')
selectcasesgn(x)+2.
box1.
printy=x^2+1
box2.
print"="xxxxxxx4
box3.
printy=x^3+100.
endselect
endsub
2.privatesubcommand1_click()
dima,b,c,d,easstring
a="zhengzhou."
b="zhongyuangongxueyuan."
c=a+b+."
d=left(a1)+mid(a,7,1)
e=left(b,1)mid(b),12
(1).
printc
printd,e
endsub
3.设有sub过程.
p1(xasintegerprivatesub,byvalhaveinteger)
x=4,=5,z=6.
endsub
则如下程序段的运行结果是.
privatesubcommand1_click()
dimxasinteger,yasinteger
x=1,y=1,z=3
printx,y,z
callp1(x,y)
printx,y,z
endsub
4.privatesubcommand1_click()
k=0.
fori=1to3.
k=k+1
a=i*i*k
printa;
nexti
endsub
5.
私有子command1_click()
a(5,5)为整数
我=1到5
J=1到5
一个(I,J)=我*2+J
打印(i,j);
下J
打印
下一个我
端子
6过程设有功能:
私有函数F1(B,A)
a一个*:
B=B×B
F1=AB
端功能
则如下程序段的运行结果是什么?
私有子command1_click()
=4:
B=3
=F1(A,B)
打印
端子
七编程题(共30分)。
注意:
艺术类学生(环艺、装潢、表演、服设)做第1256小题、、、;
其他学生做第1234小题、、、。
1。
给出一个百分制的成绩,要求输出成绩的相应等级。
(7分)
90分以上为“一”,80~89分为“B”,70~79分为“C”,60~69分为“D”,“E”60分以下为。
2求N!
,N由键盘输入。
(7分)
3。
产生20个[0,99]之间的随机整数,并按从小到大的顺序输出。
(8分)
4。
产生并输出一个6×6的二维数组一:
(8分)
(1)两条对角线上元素的值为1,其余元素为小于30的随机整数。
(2)计算各行元素的平均值,输出平均值最大和平均值最小的行号。
5。
输出1+2+100+1......的和,并求出~100之间能被17整除的数据的个数(8分)
6。
从键盘输入10个数,求出其中的最大数,最小数和平均值。
(8分)
VB试题答案及评分标准
一、单项选择题(每题1分,共10分)
1。
2。
3。
C4,C5,D
6。
7。
8。
9。
10。
B
二、填空题(每空1分,共10分)
1。
Nmod13=0和nmod17=0
1、对象
3。
左(VisualBasic6,6)
四点六
错误5。
文件大小6。
7:
8。
选项显式9。
ConstDim
三、将下列数学表达式转换成VB表达式(每题1分,共6分)
1、一^2+2*A*B+B^2
2、X^(1/3)*(1/4)^
3、8×exp(x)*日志(10)
4、2*罪(3.1416/4)×cos(3.1416/4)
5、(X+Y+Z)/平方(x^2+Y+Z^2^2)
6、日志(1+ABS((a+b)/(A-B)))
四、判断题(每题1分,共10分)
1。
×2。
√3。
×4。
√×5。
6。
√7。
×8。
×9。
×√10。
五、根据题意,将下列程序补充完整(每空1分,共10分)
1。
(1)int(RND×91)+10
(2)我<10
2。
(1)我*j
(2)下我
3.
(1)int(SQR(x))orX-1
(2)flag=1
4.
(1)dimf(15)asinteger
(2)f(I-1)+f(I-2)
Six,writetheoutputresultsofthefollowingprograms(eachof4points,atotalof24points)
1,y=65
2,ZhengZhouZhongYuanGongXueYuan2
ZZZG2
3.123
423
4.1827
5.34567
56789
7891011
910111213
1112131415
6.-7
Seven,writeaprogram
1.privatesub(command1_click)
DimxAsInteger,gradeasstring1
X=text1.text1
Selectcasex4
Case90to100
Grade=A"
Case80to89
Grade=B"
Case70to79
Grade=C"
Case60to69
Grade=D"
Caseis<60
Grade=E"
Caseelse
Pleasere-entermsgbox""
Endselect
Print"thestudentachievementfor"+grade1
EndSub
2.PrivateSub(command1_click)
Dimnasinteger,Faslong1
N=text1.text1
F=1
ForI=1toN3
F=f*I
NextI
Text2.text=f2
EndSub
3.PrivateSub(Command1_Click)
Dima(1To20)AsInteger'1
Randomize
ForI=1To202
A(I)=Int(Rnd*100)
Printa(I);
Next
ForI=1To193
ForJ=I+1To20
Ifa(I)>A(J)Then
T=a(I):
a(I)=a(J):
a(J)=t
EndIf
NextJ
NextI
ForI=1To202
Printa(I);
NextI
EndSub
4.PrivateSub(Command1_Click)
Dima(1To6,1To6AsInteger1')
DimaverAsSingle
Randomize
ForI=1To63
J=1到6
如果我,我+J=7
一个(I,J)=1
其他的
一个(I,J)=int(RND×30)
最后如果
打印(i,j);
下J
打印
下一个我
打印
max=0分钟=30:
4分
我=1到6
S=0
J=1到6
S=S+(i,j)
下J
平均=S/6
如果断言>MaxThenMax=断言:
row_max=我
如果断言<<民民=断言:
row_min=我
下一个我
打印row_max,row_min
端子
5。
私有子command1_click()
我作为整数暗淡,c为整数
定义为整数
我=11004分
S=S+我
如果我的mod17=0然后C=C+1
下一个我
打印“1+2+…+100=”;2分
打印“能被17整数的数据有”;C;“个”2分
端子
6。
私有子command1_click()
X为整型
X=InputBox(“=”)1分
打印x;
马克斯=x=x:
:
min=x2分
我=2103分
X=InputBox(“=”):
打印X;
S=S+X
如果x>MaxThenMax=x
如果x<民民=x
下一个我
打印/101分
打印马克斯,民1分
端子
应该不是真的
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 大一 vb 期末 考试题 答案