vb简易计算器实验研究报告Word文件下载.docx
《vb简易计算器实验研究报告Word文件下载.docx》由会员分享,可在线阅读,更多相关《vb简易计算器实验研究报告Word文件下载.docx(11页珍藏版)》请在冰点文库上搜索。
四则运算时直接采用计算表达式.所以,优先级和运算规则皆宜考虑在内.在进行除法运算时,若遇到除数为0,则运用条件语句执行,并在输出显示屏上输出“E”.三角函数、指数、对数、整除、取余等运算,也是运用类似手法.DXDiT。
考虑到计算器地操作简便性,所以加入了复位和退出按钮.
三、源程序文件:
PrivateSubCommand1_Click()
DimxAsInteger
DimyAsInteger
x=Text1.Text
y=Text2.Text
Text3.Text=x+y
EndSub
PrivateSubCommand10_Click()
Text3.Text=Cos(x)
PrivateSubCommand11_Click()
Text3.Text=Tan(x)
PrivateSubCommand12_Click()
Text3.Text=Atn(x)
PrivateSubCommand13_Click()
Text3.Text=x^y
PrivateSubCommand14_Click()
Ifx<
=0Then
Text3.Text="
输入错误"
Else
Text3.Text=Log(x)
EndIf
PrivateSubCommand15_Click()
此按钮仅作装饰用"
PrivateSubCommand2_Click()
Text3.Text=x-y
PrivateSubCommand3_Click()
Text3.Text=x*y
PrivateSubCommand4_Click()
Ify=0Then
E"
Text3.Text=x/y
PrivateSubCommand5_Click()
Text3.Text=x\y
PrivateSubCommand6_Click()
Text3.Text=xMody
PrivateSubCommand7_Click()
Text1.Text="
"
Text2.Text="
0"
PrivateSubCommand8_Click()
End
PrivateSubCommand9_Click()
Text3.Text=Sin(x)
源代码截图:
四、运行结果演示:
加法演示:
减法演示:
乘法演示:
除法演示:
能够整除:
不能够整除:
除数为零:
版权申明
本文部分内容,包括文字、图片、以及设计等在网上搜集整理.版权为个人所有
Thisarticleincludessomeparts,includingtext,pictures,anddesign.Copyrightispersonalownership.RTCrp。
用户可将本文地内容或服务用于个人学习、研究或欣赏,以及其他非商业性或非盈利性用途,但同时应遵守著作权法及其他相关法律地规定,不得侵犯本网站及相关权利人地合法权利.除此以外,将本文任何内容或服务用于其他用途时,须征得本人及相关权利人地书面许可,并支付报酬.5PCzV。
Usersmayusethecontentsorservicesofthisarticleforpersonalstudy,researchorappreciation,andothernon-commercialornon-profitpurposes,butatthesametime,theyshallabidebytheprovisionsofcopyrightlawandotherrelevantlaws,andshallnotinfringeuponthelegitimaterightsofthiswebsiteanditsrelevantobligees.Inaddition,whenanycontentorserviceofthisarticleisusedforotherpurposes,writtenpermissionandremunerationshallbeobtainedfromthepersonconcernedandtherelevantobligee.jLBHr。
转载或引用本文内容必须是以新闻性或资料性公共免费信息为使用目地地合理、善意引用,不得对本文内容原意进行曲解、修改,并自负版权等法律责任.xHAQX。
Reproductionorquotationofthecontentofthisarticlemustbereasonableandgood-faithcitationfortheuseofnewsorinformativepublicfreeinformation.Itshallnotmisinterpretormodifytheoriginalintentionofthecontentofthisarticle,andshallbearlegalliabilitysuchascopyright.LDAYt。