المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : igأريد تصحيح هذا الكود



badbadtoo
03-03-2011, 16:58
Le code :

Public Class Form1

Dim a As Double

Dim b As Double

Dim c As Double

Dim d As Double

Dim x1 As Double

Dim x2 As Double








Dim sqrt As Double


Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click



End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged



End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

a = TextBox1.Text

b = TextBox2.Text

c = TextBox3.Text

d = (b * b) - (4 * a * c)



If a = 0 And b = 0 Then

MsgBox("l’équation n’admet pas de solution ")

Else

If d < 0 Then

MsgBox("la solution est l'ensembl vide ")

Else

If d = 0 And a <> 0 Then

x1 = (-b) / a

TextBox4.Text = x1

Else

If d > 0 And a <> 0 Then

x1 = (-b + (Math.Sqrt(d))) / (2 * a)

x2 = (-b - (Math.Sqrt(d))) / (2 * a)

TextBox4.Text = x1

TextBox5.Text = x2

End If

End If

End If

End If

End Sub



End Class

™Raeno
04-03-2011, 11:52
المكان الصحيح لاستفسارك هو قسم البرمجة
https://www.arabhardware.net/forum/forumdisplay.php?f=96