需要完整版的近似科学型计算器的vb代码,拜托拜托。
邮箱给我 我发给你
打开VB编辑器界面,建立UserForm1添加好如图的控件改动好对应的Caption
加号按钮的程序代码
清除按钮的程序代码
退出按钮的程序代码
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
Caption = "简易计算器 V1.0"
ClientHeight = 5025
ClientLeft = 45
ClientTop = 375
ClientWidth = 4440
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5025
ScaleWidth = 4440
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 4935
Left = 120
TabIndex = 0
Top = 0
Width = 4215
Begin VB.CommandButton cmdQuit
Caption = "Quit"
Height = 495
Left = 2160
TabIndex = 21
Top = 4080
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "4"
Height = 495
Index = 4
Left = 480
TabIndex = 20
Top = 1920
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "5"
Height = 495
Index = 5
Left = 1320
TabIndex = 19
Top = 1920
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "6"
Height = 495
Index = 6
Left = 2160
TabIndex = 18
Top = 1920
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "7"
Height = 495
Index = 7
Left = 480
TabIndex = 17
Top = 2640
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "8"
Height = 495
Index = 8
Left = 1320
TabIndex = 16
Top = 2640
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "9"
Height = 495
Index = 9
Left = 2160
TabIndex = 15
Top = 2640
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "0"
Height = 495
Index = 0
Left = 480
TabIndex = 14
Top = 3360
Width = 615
End
Begin VB.CommandButton cmdDecimal
Caption = "."
Height = 495
Left = 1320
TabIndex = 13
Top = 3360
Width = 615
End
Begin VB.CommandButton cmdOperator
Caption = "-"
Height = 495
Index = 2
Left = 3000
TabIndex = 12
Top = 1920
Width = 615
End
Begin VB.CommandButton cmdOperator
Caption = "*"
Height = 495
Index = 3
Left = 3000
TabIndex = 11
Top = 2640
Width = 615
End
Begin VB.CommandButton cmdOperator
Caption = "/"
Height = 495
Index = 4
Left = 3000
TabIndex = 10
Top = 3360
Width = 615
End
Begin VB.CommandButton cmdClear
Caption = "→"
Height = 495
Left = 480
TabIndex = 9
Top = 4080
Width = 615
End
Begin VB.CommandButton cmdClearEntry
Caption = "AC"
Height = 495
Left = 1320
TabIndex = 8
Top = 4080
Width = 615
End
Begin VB.CommandButton cmdEquals
Caption = "="
Height = 495
Left = 3000
TabIndex = 7
Top = 4080
Width = 615
End
Begin VB.CommandButton cmdPlusMinus
Caption = "-"
Height = 495
Left = 2160
TabIndex = 6
Top = 3360
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "1"
Height = 495
Index = 1
Left = 480
TabIndex = 5
Top = 1200
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "2"
Height = 495
Index = 2
Left = 1320
TabIndex = 4
Top = 1200
Width = 615
End
Begin VB.CommandButton cmdNumber
Caption = "3"
Height = 495
Index = 3
Left = 2160
TabIndex = 3
Top = 1200
Width = 615
End
Begin VB.CommandButton cmdOperator
Caption = "+"
Height = 495
Index = 1
Left = 3000
TabIndex = 2
Top = 1200
Width = 615
End
Begin VB.TextBox txtDisplay
Alignment = 1 'Right Justify
BackColor = &H00404040&
BeginProperty Font
Name = "新宋体"
Size = 15
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0080FFFF&
Height = 495
Left = 360
TabIndex = 1
Top = 480
Width = 3375
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private StoredValue As Double
Private Const opNone = 0
Private Const opAdd = 1
Private Const opSubtract = 2
Private Const opMultiply = 3
Private Const opDivide = 4
Private Operator As Integer
Private NewEntry As Boolean
'删除最后的字符
Private Sub DeleteCharacter()
Dim txt As String
Dim min_len As Integer
txt = txtDisplay.Text
If Left$(txt, 1) = "-" Then
min_len = 2
Else
min_len = 1
End If
If Len(txt) > min_len Then
txtDisplay.Text = Left$(txt, Len(txt) - 1)
Else
txtDisplay.Text = "0"
End If
End Sub
'清除最后一位
Private Sub cmdClear_Click()
If Len(txtDisplay.Text) > 0 Then txtDisplay.Text = Left(txtDisplay.Text, Len(txtDisplay.Text) - 1)
txtDisplay.SetFocus
End Sub
'清除显示内容,保存运算符
Private Sub cmdClearEntry_Click()
txtDisplay.Text = ""
StoredValue = 0
Operator = opNone
txtDisplay.SetFocus
End Sub
' 显示小数点
Private Sub cmdDecimal_Click()
If InStr(txtDisplay.Text, ".") Then
Beep
Else
If NewEntry Then
txtDisplay.Text = "."
NewEntry = False
Else
txtDisplay.Text = txtDisplay.Text & "."
End If
End If
txtDisplay.SetFocus
End Sub
'计算上一操作符的运算结果
Private Sub cmdEquals_Click()
Dim new_value As Double
If txtDisplay.Text = "" Then
new_value = 0
Else
new_value = CDbl(txtDisplay.Text)
End If
Select Case Operator
Case opNone
StoredValue = new_value
Case opAdd
StoredValue = StoredValue + new_value
Case opSubtract
StoredValue = StoredValue - new_value
Case opMultiply
StoredValue = StoredValue * new_value
Case opDivide
StoredValue = StoredValue / new_value
End Select
Operator = opNone
NewEntry = True
txtDisplay.Text = Format$(StoredValue)
txtDisplay.SetFocus
End Sub
' 显示数字
Private Sub cmdNumber_Click(Index As Integer)
If NewEntry Then
txtDisplay.Text = Format$(Index)
NewEntry = False
Else
txtDisplay.Text = txtDisplay.Text & Format$(Index)
End If
txtDisplay.SetFocus
End Sub
Private Sub cmdOperator_Click(Index As Integer)
cmdEquals_Click
Operator = Index
NewEntry = True
txtDisplay.SetFocus
End Sub
'改变符号
Private Sub cmdPlusMinus_Click()
If NewEntry Then
txtDisplay.Text = "-"
ElseIf Left$(txtDisplay.Text, 1) = "-" Then
txtDisplay.Text = Right$(txtDisplay.Text, 2)
Else
txtDisplay.Text = "-" & txtDisplay.Text
End If
txtDisplay.SetFocus
End Sub
'处理键盘按键
Private Sub Form_KeyPress(KeyAscii As Integer)
txtDisplay_KeyPress KeyAscii
End Sub
Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
txtDisplay_KeyUp KeyCode, Shift
End Sub
Private Sub txtDisplay_Change()
txtDisplay.SelStart = Len(txtDisplay.Text)
End Sub
Private Sub txtDisplay_GotFocus()
txtDisplay_Change
End Sub
Private Sub txtDisplay_KeyPress(KeyAscii As Integer)
Dim ch As String
ch = Chr$(KeyAscii)
Select Case ch
Case "0"
cmdNumber_Click 0
Case "1"
cmdNumber_Click 1
Case "2"
cmdNumber_Click 2
Case "3"
cmdNumber_Click 3
Case "4"
cmdNumber_Click 4
Case "5"
cmdNumber_Click 5
Case "6"
cmdNumber_Click 6
Case "7"
cmdNumber_Click 7
Case "8"
cmdNumber_Click 8
Case "9"
cmdNumber_Click 9
Case "*", "x", "X"
cmdOperator_Click opMultiply
Case "+"
cmdOperator_Click opAdd
Case vbCrLf, vbCr, "="
cmdEquals_Click
Case "-"
cmdOperator_Click opSubtract
Case "."
cmdDecimal_Click
Case "/"
cmdOperator_Click opDivide
Case "C", "c"
cmdClearEntry_Click
End Select
KeyAscii = 0
End Sub
Private Sub txtDisplay_KeyUp(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyNumpad0
cmdNumber_Click 0
Case vbKeyNumpad1
cmdNumber_Click 1
Case vbKeyNumpad2
cmdNumber_Click 2
Case vbKeyNumpad3
cmdNumber_Click 3
Case vbKeyNumpad4
cmdNumber_Click 4
Case vbKeyNumpad5
cmdNumber_Click 5
Case vbKeyNumpad6
cmdNumber_Click 6
Case vbKeyNumpad7
cmdNumber_Click 7
Case vbKeyNumpad8
cmdNumber_Click 8
Case vbKeyNumpad9
cmdNumber_Click 9
Case vbKeyMultiply
cmdOperator_Click opMultiply
Case vbKeyAdd
cmdOperator_Click opAdd
Case vbKeySeparator
cmdEquals_Click
Case vbKeySubtract
cmdOperator_Click opSubtract
Case vbKeyDecimal
cmdDecimal_Click
Case vbKeyDivide
cmdOperator_Click opDivide
Case vbKeyBack, vbKeyDelete
DeleteCharacter
End Select
KeyCode = 0
End Sub
祝好运 实在不行就修改自己同学的吧
等我午睡起来给你写哈!~~~~
嗯..帮不了..刚看到..
马上要上班了.对不住了..
网上有源码..自己百度一下.
如何用科学记数法表示近似数
如何用科学记数法表示近似数如下:1、确定要表示的数的值和精确度。精确度可以理解为对一个数进行四舍五入操作后的精度,例如精确到小数点后两位等。2、根据精确度将这个数四舍五入到指定的小数位。例如,如果要将2.4983精确到十分位,看十分位的下一位,百分位是9,向前一位进1,然后舍去,得2...
找近似数的方法
1、四舍五入:最简单的方法是使用四舍五入来近似一个数。例如,如果你需要将3.78近似到个位数,你可以将其四舍五入为。截断:另一种方法是截断,即去掉一个数的小数部分,只保留整数部分。例如,将5.63截断为5。2、近似到特定小数位数:如果需要将一个数近似到特定的小数位数,你可以将其截断或...
初中近似数 科学计数法 负 怎么看精确到哪一位
1.1这叫精确到十分位 1.12……百分位 1.123千分位 0.0032万分位 2.65万 百分位 1.595=1.6*10零次方
科学计数法 近似值
12000=1.2乘10的4次方 13000=1.3乘10的4次方
怎么求科学记数法的近似数,急急急~
就是2.0乘以十的五次方啊 你就把它写成一般形式 数到万位 进行近似 然后再用科学技术法表示即可 很简单哦 加油
11910000分别取他的近似数。并用科学计数法表示。进来看。
11910000 1、精确到万位1.191*10^7 2、精确到百万位1.2*10^7 3、精确到千万位1*10^7
数学 近似数 精确到 科学计数法 七年级
5.28*10的六次方 有(3)个有效数字,精确到(百万)位 5.28*10的六次方=528000000,故精确到百万位 14.173万是精确到(十位)的近似数,有(5)个有效数字,他们是(1,4,1,7,3)14.173万=141730,故精确到十位 希望有帮到你!
怎么样才能求出近似数?
2、求近似数时要记住,保留到哪一位,就看这个数位的后一位的大小,保留后的数末尾0不能省略。如求6.597的近似数到百分位,小数点后边的9为百分位,看百分位后边千分位7,大于5进1到百分位,9+1=10,在百分位写下0再进1到十分位,十分位变成5+1=6,最后结果为6.60,如果写成6.6是错误...
怎样计算科学计数法的近似数。要方法。。 例如6.48×10的5次方(精确到...
6.48×10的5次方=648000≈650000=6.5×10的5次方
304.35精确到10位的近似数(带科学计数法过程)
304.35 =3.0435×10^2 ≈3.0×10^2。
五章杞菊: 打开VB编辑器界面,建立UserForm1添加好如图的控件改动好对应的Caption 加号按钮的程序代码 清除按钮的程序代码 退出按钮的程序代码
汕头市17771452751: vb科学计算器?
五章杞菊: 欢迎看一下我的计算器, 有程序界面, 你可以参考一下,添加运算功能. http://hi.baidu.com/jack%5Fican/blog/item/f3ab762acc95133a5243c1a2.html 说明:1.共有4个文本框其,其中三个是填入或输出数据的(名称分别是:txta txtb txtc),剩...
汕头市17771452751: 有谁知道用vb编计算器 要带科学计算法的?
五章杞菊: 如果看着太累就做成2个窗体,思维能清楚点 一个窗体就是显示和位置的的排例,做好科学型的,再用代码把控件排成普通的就OK了. 你先看msdn里带的救命的普通的算法, 再做科学的就容易了.
汕头市17771452751: VB计算圆周率π的近似值 - ?
五章杞菊: 完整的代码如下:Dim Pi As Single Dim i As Single Dim Fh As Integer Fh = -1 Pi = 0 For i = 1 To 1000000Fh = -1 * FhPi = Pi + Fh / (2 * i - 1) Next i Pi = Pi * 4 Print Pi
汕头市17771452751: 谁能帮我做2套VB计算器,,,小弟在此感谢!!! - ?
五章杞菊: 控件自己看着添加给你张图Option ExplicitDim dflag As IntegerDim i As IntegerDim opnre As IntegerDim prev As DoubleDim oflag As IntegerDim ind As IntegerPriv...
汕头市17771452751: VB中科学型计算器的程序代码谁能给我编啊??
五章杞菊: 或许我可以帮你 308259156
汕头市17771452751: 科学型计算器VB谁会编?只要+ - */ 三角函数 进制转换?
五章杞菊:是类似于这样的吗?窗体你必须自己加,因为vbp文件如果一旦改变路径,你将 打不开它,这一点你应该知道吧.就是说如果我把我的工程文件发给你,你打开 的时候系统将提示找不到文件名路径,加载错误! 给你一段代码你自己改一下(不...
汕头市17771452751: VB科学计算器?
五章杞菊: 去csdn找下,或者程序员联合开发网,csdn的博客也可以找,下载那可以找相关资料找找 www.csdn.net
汕头市17771452751: vb 科学型计算器 求编程?
五章杞菊: 看看这个教程就明白了: http://wenku.baidu.com/view/4929991ca76e58fafab003d6.html
汕头市17771452751: 求一个 JAVA 的 科学计算器 的 源代码最好里面有 sin cos 倒数、平方根、平方、立方高级一点的! - ?
五章杞菊: import javax.swing.*;import java.awt.*;import java.awt.event.*;public class Calculator implements ActionListene...