تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
تطبيق منقول - آلة حاسبة بالكتابة المباشرة
#1
كاتب الموضوع : AhmedEssawy


كود :
Dim WithEvents tx1 As VB.TextBox, WithEvents tx2 As VB.TextBox
Dim WithEvents tx3 As VB.TextBox, txv As VB.Label
Function mini_1$(a, b, D): mini_1 = (-b + Sqr(D)) / (2 * a): End Function
Function mini_2$(a, b, c, x): mini_2 = a * x ^ 2 + b * x + c: End Function
Sub tagasta(): txv.Caption = arvuta(Val(tx1.Text), Val(tx2.Text), Val(tx3.Text)): End Sub
Private Sub Tx1_Change(): Call tagasta: End Sub
Private Sub Tx2_Change(): Call tagasta: End Sub
Private Sub Tx3_Change(): Call tagasta: End Sub
Private Sub Form_Load()
With Me: .Height = 2500: .Visible = True: .Caption = "Ruutvõrrand": End With
Set tx1 = Form1.Controls.Add("VB.TextBox", "tx1", Form1)
With tx1: .Move 100, 1 * 300, 4500, 100: .Visible = True: .Text = i: End With
Set tx2 = Form1.Controls.Add("VB.TextBox", "tx2", Form1)
With tx2: .Move 100, 2 * 300, 4500, 100: .Visible = True: .Text = i: End With
Set tx3 = Form1.Controls.Add("VB.TextBox", "tx3", Form1)
With tx3: .Move 100, 3 * 300, 4500, 100: .Visible = True: .Text = i: End With
Set txv = Form1.Controls.Add("VB.Label", "txv", Form1)
With txv: .Move 100, 4 * 300, 4500, 900: .Visible = True: End With
End Sub
Function arvuta(a!, b!, c!) As String
On Error GoTo viga
Dim x1!, x2!, D!, z1!, z2!, RV$
RV = Chr(13) & Chr(10)

If a = 0 Then 'ruutvõrrand?
arvuta = "f( " & a & " * x^2 " & IIf(b < 0, "", "+") & b & " * x " & _
IIf(c < 0, "", "+") & c & " ): " & RV & "Pole ruutv&Atilde;µrrand"
Else 'ei ole
D = b * b - 4# * a * c
If D >= 0 Then 'kerge?
x1 = mini_1(a, -b, D)
x2 = mini_1(a, b, D)

arvuta = "f( " & a & " * x^2 " & IIf(b < 0, "", "+") & b & " * x " & _
IIf(c < 0, "", "+") & c & " ); D:" & D & RV & _
"x_1: " & x1 & " ja x_2: " & x2 & RV & _
"y_1: " & mini_2(a, b, c, x1) & " ja y_2: " & mini_2(a, b, c, x2)
Else 'ei ole kerge
ruut = Sqr(-root) / (2 * a)
x1 = -b / (2 * a)
z1 = x1 * -D
z2 = x1 * D

arvuta = "f( " & a & " * x^2 " & IIf(b < 0, "", "+") & b & " * x " & _
IIf(c < 0, "", "+") & c & " ); D:" & D & RV & _
"x_(1;2) : " & x1 & " * +- i * " & D & RV & _
"y_1: " & mini_2(a, b, c, z1) & " ja y_2: " & mini_2(a, b, c, z2)
End If
End If
Exit Function

viga:
arvuta = "Sisestasid liiga suure arvu"
End Function
http://www.dreamincode.net/code/snippet830.htm
}}}}
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  تطبيق كامل منقول - لعبة Xo - 1 RaggiTech 0 362 17-10-12, 12:36 AM
آخر رد: RaggiTech
  تطبيق كامل منقول - قراءة وتعديل صورة Jpeg RaggiTech 0 438 17-10-12, 12:35 AM
آخر رد: RaggiTech

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم