VB实验报告册答案及考试大纲Word下载.docx
- 文档编号:16782893
- 上传时间:2022-11-26
- 格式:DOCX
- 页数:26
- 大小:20.92KB
VB实验报告册答案及考试大纲Word下载.docx
《VB实验报告册答案及考试大纲Word下载.docx》由会员分享,可在线阅读,更多相关《VB实验报告册答案及考试大纲Word下载.docx(26页珍藏版)》请在冰豆网上搜索。
BCBCC,CBBDA,CCCBA,CBDCC
二
form_click()
interval,5000
vbp,frm
top,left,height,width,像素
picture
locked
font,alignment
gotfocus,lostfocus
属性窗口,代码
三
2-1
Label3=Text1*Text2
Label3=Text1/Text2
2-2
Picture1.Visible=True
Picture1=LoadPicture("
C:
\DocumentsandSettings\AllUsers\Documents\MyPictures\示例图片\Waterlilies.jpg"
\DocumentsandSettings\AllUsers\Documents\MyPictures\示例图片\Winter.jpg"
Picture1.Visible=False
2-3
2-4
Text2=Text1
Text1="
Text2="
PrivateSubText1_Change()
Command1.Visible=True
Command2.Visible=True
2-5
Timer1.Interval=500
Timer1.Interval=0
PrivateSubTimer1_Timer()
Image1.Left=Int(Rnd*(Form1.ScaleWidth-Image1.Width))
Image1.Top=Int(Rnd*(Form1.ScaleHeight-Image1.Height))
实验三
A(BC)(BC)AA,A(BCD)DBB,B
3,4,5,6,8,10,11,12,14,15,16
abs(x+y)
(3+x*y)^2
(-b+sqr(b^2-4*a*c)/(2*a)
sin(30*3.14/180)+exp
(2)
四
int(rnd*71+20)
x*y<
xmod3=0orxmod7=0
x>
=10andx<
20
="
A"
andx<
Z"
left(s,3)或者,mid(s,1,3)
五
3-2
DimxAsSingle
x=Val(Text1)
PrintFormat(x^2,"
##.000"
),Format(Sqr(x),"
),Format(x^3,"
),Format(x^(1/3),"
3-3
DimxAsInteger
x=Int(Rnd*900+100)
Text1=Trim(Str(x))
Text2=Right(Text1,1)+Mid(Text1,2,1)+Left(Text1,1)
3-4
Dimmax,minAsInteger
min=Val(Text1)
max=Val(Text2)
Randomize
PrintInt(Rnd*(max-min+1)+min),Int(Rnd*(max-min+1)+min),Int(Rnd*(max-min+1)+min)
3-5
Text1=Date
Text2=Time
Text3=WeekdayName(Weekday(Date))
实验四
CDCDA,DBBAC
(1)48.71E-01,-4.8712
(2)关系,逻辑,数值
(3)900,100,mid(a,2,1),c
(4)
m
1,2,3
printm&
"
月是第二季度"
endselect
(1)x=4y=13
(2)10
4-1
Dimnum,a1,a2,a3AsSingle
num=Val(Text1)*180/3.14
a1=Int(num)
num=num-a1
a2=Int(num*60)
num=num*60-a2
a3=Format(num*60,"
Printa1,a2,a3
4-2
DimyAsInteger
y=Val(Text1)
If(yMod400=0OryMod4=0AndyMod100<
>
0)Then
MsgBoxy&
是闰年"
Else
不是闰年"
EndIf
4-3
Dimx,y,z,tAsInteger
x=Val(InputBox("
inputx:
))
y=Val(InputBox("
inputy:
z=Val(InputBox("
inputz:
Ifx>
yThent=x:
x=y:
y=t
Ify>
zThen
t=y:
y=z:
z=t
Ifx>
Printx,y,z
4-4
DimnettimeAsInteger,moneyAsSingle
nettime=Val(InputBox("
每月上网时数:
"
上网费用"
Ifnettime=-1Then
money=0
ElseIfnettime<
10Then
money=25
50Then
money=nettime*2
100Then
money=nettime*1.5
200Then
money=nettime
money=200
Ifmoney<
0ThenMsgBox"
该月上网费用为"
&
money&
元"
实验五
BCBAC
(1)forx=1to10
s*(1-1/x)
(2)
t<
1E-6
(3)
j
t
5
115
5-1
Dimi,sumAsInteger
sum=0
Fori=1To100
sum=sum+i
1+2+...+100="
;
sum
5-2
Dimx,yAsInteger
Forx=0To20
Fory=0To33
If5*x+3*y+(100-x-y)/3=100Then
Printx,y,100-x-y
EndIf
Nexty
Nextx
5-3
DimiAsInteger
i=7
Do
IfiMod2=1AndiMod3=2AndiMod5=4AndiMod6=5AndiMod7=0Then
Printi
ExitDo
i=i+7
Loop
5-4
Dimx,y,zAsInteger
Forx=1To9
Fory=1To9
Forz=0To9
If100*x+10*x+z+100*y+10*z+z=532Then
Printx,y,z
Nextz
Nextx
5-5
DimsumAsSingle,nAsInteger
sum=1
DoWhilesum<
=4
sum=sum*1.1
n=n+1
经过"
n;
年销售收入翻两番"
5-6
Dimsum,i,nAsInteger
n=Val(InputBox("
请输入n的值:
Fori=1Ton
sum=sum+i*(-1)^(i+1)
1-2+3-4+...="
5-7
Dimsum,isum,i,nAsInteger
isum=0
isum=isum+i
sum=sum+isum
1+(1+2)+(1+2+3)+...="
5-8
Dimpi,tiAsSingle
pi=0
ti=1
i=1
DoWhileAbs(ti)>
=0.0001
ti=(-1)^(i+1)/(2*i-1)
pi=pi+ti
i=i+1
5-9
Dimi,j,kAsInteger
水仙花数有:
Fori=1To9
Forj=0To9
Fork=0To9
Ifi*100+j*10+k=i^3+j^3+k^3Then
Printi,j,k
Nextk
Nextj
5-10
k=0
Fori=999To100Step-1
Forj=2ToInt(Sqr(i))
IfiModj=0ThenExitFor
Ifj=Int(Sqr(i))+1Thenk=k+1:
Ifk=3ThenExitFor
5-11
Dimi,n,min,maxAsInteger
DimaverAsSingle
min=100
max=50
Fori=1To20
n=Int(Rnd*(99-51)+51)
Printn;
IfiMod5=0ThenPrint
Ifn>
maxThenmax=n
Ifn<
minThenmin=n
aver=aver+n
max="
max
min="
min
average="
aver/20
5-12
PrivateSubCommand12_Click()
Dimi,jAsInteger
Fori=1To5
Forj=1To(2*i-1)
PrintTab(20-i+j);
*"
Nextj
实验六
BCCCDDDDCA
二、
6-1
OptionBase1
Dimia(10)AsInteger
DimMax,min,averAsInteger,iMax,iminAsInteger
Fori=1To10
ia(i)=Int(Rnd*51+50)
Printia(i);
Max=ia
(1):
iMax=1
min=ia
(1):
imin=1
aver=ia
(1)
Fori=2To10
aver=aver+ia(i)
Ifia(i)>
MaxThenMax=ia(i):
iMax=i
Ifia(i)<
minThenmin=ia(i):
imin=i
Max,"
imax="
iMax
min,"
imin="
imin
aver="
aver/10
6-2
Dimia(20),num(5)AsInteger
ia(i)=Int(Rnd*101)
SelectCaseia(i)
CaseIs<
60
num
(1)=num
(1)+1
Case60To69
num
(2)=num
(2)+1
Case70To79
num(3)=num(3)+1
Case80To89
num(4)=num(4)+1
Case90To100
num(5)=num(5)+1
EndSelect
各分数段的人数分别是(0~59,60~69,70~79,80~89,90~100):
Printnum(i);
6-3
Dima(10)AsInteger,t%
a(i)=Int(Rnd*51)
Printa(i);
Forj=i+1To10
Ifa(i)<
a(j)Thent=a(i):
a(i)=a(j):
a(j)=t
排序后:
6-4
Dima(20)AsInteger,t%
If(i+1)Mod5=0ThenPrint
6-5
Dima(9),b(3,3)AsInteger,s%,t%
a(i)=Int(Rnd*101)
IfiMod3=0Then
t=3:
s=i/3
Else
t=iMod3:
s=i\3+1
b(s,t)=a(i)
Fori=1To3
Forj=1To3
Printb(i,j);
6-6
Dima()AsInteger
n=InputBox("
n=?
ReDima(n,n)
Forj=1Ton
a(i,j)=Int(Rnd*10)
Printa(i,j);
6-7
a(i,i)=1
6-8
Dimia()AsInteger
DimMaxAsInteger,iMax,jmaxAsInteger
m=InputBox("
m=?
ReDimia(m,n)
Max=0:
iMax=0:
jmax=0
Fori=1Tom
ia(i,j)=Int(Rnd*101)
Printia(i,j);
Ifia(i,j)>
MaxThenMax=ia(i,j):
iMax=i:
jmax=j
iMax,"
jmax="
jmax
实验七
CCDABDDAAA
(1)n!
(2)1到n累加和
(3)n是否是素数
(4)冒泡排序
(5)递归调用实现斐波那契数列
(6)求最大公约数和最小公倍数
7-1
Dimn,sumAsInteger
sum=jsh(n)
1!
+2!
+...+"
!
PublicFunctionjsh(n)AsInteger
Dimi,s,tAsInteger
s=0
t=1
t=t*i
s=s+t
jsh=s
EndFunction
7-2
Dimn,flagAsInteger
flag=1
sushun,flag
n="
flag
PublicSubsushu(n,flag)
Fori=2Ton-1
IfnModi=0Thenflag=0:
ExitFor
7-3
PrivateSubC
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- VB 实验 报告 答案 考试 大纲
![提示](https://static.bdocx.com/images/bang_tan.gif)