南工程VB课程设计Word文件下载.docx
- 文档编号:7196991
- 上传时间:2023-05-08
- 格式:DOCX
- 页数:20
- 大小:27.36KB
南工程VB课程设计Word文件下载.docx
《南工程VB课程设计Word文件下载.docx》由会员分享,可在线阅读,更多相关《南工程VB课程设计Word文件下载.docx(20页珍藏版)》请在冰点文库上搜索。
PrivateSubcommamd2_Click(IndexAsInteger)
SelectCaseIndex
Case3
race(3)
Case2
race
(2)
Case1
race
(1)
Case0
race(0)
EndSelect
PrivateSubCommand1_Click(IndexAsInteger)
strin="
0"
receivenum(strin)
1"
2"
3"
Case4
4"
Case5
5"
Case6
6"
Case7
7"
Case8
8"
Case9
9"
Case10
A"
Case11
B"
Case12
C"
Case13
D"
Case14
E"
Case15
F"
PrivateSub等号_Click()
cal(caltype)
PrivateSubForm_Load()
PublicFunctionreceivenum(ByValstrinAsString)
optstr1=optstr1+strin
Text1.Text=optstr1
optstr2=optstr2+strin
Text1.Text=optstr2
EndFunction
PublicFunctioncal(ByValint1AsInteger)
SelectCaseint1
CaseIs=3
optstr1=Val(optstr1)+Val(optstr2)
CaseIs=2
optstr1=Val(optstr1)-Val(optstr2)
CaseIs=1
optstr1=Val(optstr1)*Val(optstr2)
CaseIs=0
optstr1=Val(optstr1)/Sqr(Val(optstr2))
IfVal(optstr2)=0Then
Text1.Text="
除数不能为零!
caltype=0
opt2=False
ExitFunction
Else
optstr1=Val(optstr1)/Sqr(Val(optstr2))
CaseElse
Text1.Text=Format(Val(optstr1),"
0.#############"
)
begincal=True
PublicSubrace(ByValint2AsInteger)
caltype=int2
opt2=True
cal(caltype)
PrivateSub二进制_Click()
Command1(0).Enabled=True
Command1
(1).Enabled=True
Command1
(2).Enabled=False
Command1(3).Enabled=False
Command1(4).Enabled=False
Command1(5).Enabled=False
Command1(6).Enabled=False
Command1(7).Enabled=False
Command1(8).Enabled=False
Command1(9).Enabled=False
Command1(10).Enabled=False
Command1(11).Enabled=False
Command1(12).Enabled=False
Command1(13).Enabled=False
Command1(14).Enabled=False
Command1(15).Enabled=False
开方.Enabled=False
平方.Enabled=False
立方.Enabled=False
取倒数.Enabled=False
小数点.Enabled=False
Dimm0%
m0=Val(Text1.Text)
Text1.Text=trandec(m0)
PrivateSub二进制_DblClick()
Diml0$
l0=Text1.Text
Text1.Text=shltoer(l0)
PrivateSub开方_Click()
optstr1=Val(optstr1)
Ifoptstr1<
0Then
被开方数不能为负数!
Text1.Text=Sqr(optstr1)
optstr1=Sqr(optstr1)
optstr2=Val(optstr2)
Ifoptstr2<
Text1.Text=Sqr(optstr2)
optstr2=Sqr(optstr2)
PrivateSub立方_Click()
Text1.Text=optstr1^3
optstr1=optstr1^3
Text1.Text=optstr2^3
PrivateSub平方_Click()
Text1.Text=optstr1^2
optstr1=optstr1^2
Text1.Text=optstr2^2
PrivateSub取倒数_Click()
被除数不能为负数!
Text1.Text=Format(1/optstr1,"
0.##########################"
optstr1=1/optstr1
Text1.Text=Format(1/optstr2,"
optstr2=1/optstr2
PrivateSub十进制_Click()
Command1
(2).Enabled=True
Command1(3).Enabled=True
Command1(4).Enabled=True
Command1(5).Enabled=True
Command1(6).Enabled=True
Command1(7).Enabled=True
Command1(8).Enabled=True
Command1(9).Enabled=True
开方.Enabled=True
平方.Enabled=True
立方.Enabled=True
取倒数.Enabled=True
小数点.Enabled=True
Dimn0&
n0=Val(Text1.Text)
Text1.Text=ertosh(n0)
PrivateSub十进制_DblClick()
Dimj0AsString
j0=Text1.Text
Text1.Text=shltosh(j0)
PrivateSub十六进制_Click()
Command1(10).Enabled=True
Command1(11).Enabled=True
Command1(12).Enabled=True
Command1(13).Enabled=True
Command1(14).Enabled=True
Command1(15).Enabled=True
Dimh0AsLong
h0=Text1.Text
Text1.Text=shtoshl(h0)
PrivateSub十六进制_DblClick()
Dimg0AsString
g0=Text1.Text
Text1.Text=ertoshl(g0)
PrivateSub小数点_Click()
IfInStr(Text1.Text,"
."
)=0Then
PrivateSub正负号_Click()
optstr1=-1*Val(optstr1)
optstr2=-1*Val(optstr2)
PublicFunctiontrandec(ByValm%)
Dimstrdtor$,mr%
strdtor="
DoWhilem<
>
0
mr=mMod2
m=m\2
strdtor=mr&
strdtor
Loop
trandec=strdtor
PublicFunctionertosh(ByValn$)
DimiAsLong,aAsInteger,BAsInteger,CAsInteger
Fori=1ToLen(n)
a=Mid(n,i,1)
B=a*2^(Len(n)-i)
C=C+B
Nexti
ertosh=C
PublicFunctionshltoer(ByVall$)
DimiAsLong
DimBAsString
Fori=1ToLen(l)
SelectCaseMid(l,i,1)
Case"
:
B=B&
"
0000"
0001"
0010"
0011"
0100"
0101"
0110"
0111"
1000"
1001"
1010"
1011"
1100"
1101"
1110"
1111"
EndSelect
WhileLeft(B,1)="
B=Right(B,Len(B)-1)
Wend
shltoer=B
PublicFunctionshltosh(ByValjAsString)
DimBAsLong
Fori=1ToLen(j)
SelectCaseMid(j,Len(j)-i+1,1)
B=B+16^(i-1)*0
B=B+16^(i-1)*1
B=B+16^(i-1)*2
B=B+16^(i-1)*3
B=B+16^(i-1)*4
B=B+16^(i-1)*5
B=B+16^(i-1)*6
B=B+16^(i-1)*7
B=B+16^(i-1)*8
B=B+16^(i-1)*9
B=B+16^(i-1)*10
B=B+16^(i-1)*11
B=B+16^(i-1)*12
B=B+16^(i-1)*13
B=B
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 工程 VB 课程设计
![提示](https://static.bingdoc.com/images/bang_tan.gif)