<VB数理统计实用算法>书中的算法源程序
源代码在线查看: 二项式分布f.frm
VERSION 5.00
Begin VB.Form frmInput
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "二项式分布"
ClientHeight = 2460
ClientLeft = 60
ClientTop = 450
ClientWidth = 2715
LinkTopic = "Form1"
ScaleHeight = 2460
ScaleWidth = 2715
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton cmdNew
Caption = "重 作"
Height = 375
Left = 1800
TabIndex = 7
Top = 1920
Width = 735
End
Begin VB.CommandButton cmdExit
Caption = "退 出"
Height = 375
Left = 960
TabIndex = 6
Top = 1920
Width = 735
End
Begin VB.CommandButton cmdCalculate
Caption = "计 算"
Height = 375
Left = 120
TabIndex = 5
Top = 1920
Width = 735
End
Begin VB.TextBox Text2
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1680
TabIndex = 4
Top = 1560
Width = 855
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Appearance = 0 'Flat
Height = 270
Left = 1680
TabIndex = 3
Top = 1080
Width = 855
End
Begin VB.Label Label3
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "出现一次的概率:"
ForeColor = &H80000008&
Height = 255
Left = 240
TabIndex = 2
Top = 1560
Width = 1455
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "试验次数:"
ForeColor = &H80000008&
Height = 255
Left = 480
TabIndex = 1
Top = 1080
Width = 1215
End
Begin VB.Label Label1
Alignment = 2 'Center
Appearance = 0 'Flat
BackColor = &H80000005&
Caption = "输入数据"
BeginProperty Font
Name = "隶书"
Size = 21.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H80000008&
Height = 615
Left = 360
TabIndex = 0
Top = 240
Width = 2055
End
End
Attribute VB_Name = "frmInput"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'二项式分布
Option Explicit
'计算
Private Sub cmdCalculate_Click()
n = Val(Text1.Text): p = Val(Text2.Text)
x = n
ReDim A(1 To 3, 0 To x)
ABino n, p, x, A
Unload Me
frmOutput.Visible = True
End Sub
'退出
Private Sub cmdExit_Click()
Unload Me
End
End Sub
'重新
Private Sub cmdNew_Click()
Text1.Text = "": Text2.Text = "": Text3.Text = ""
End Sub