résolution des équations du 2nd ordre
2 participants
Page 1 sur 1
résolution des équations du 2nd ordre
mes amis , voilà comme je vous ai promet , un programme pour vous faciliter la résolutions des équations assez compliqués
Dim a, b, c, di, racdi As Double
Private Sub cmdcalcul_Click()
a = CDbl(txtvaria.Text)
b = CDbl(txtvarib.Text)
c = CDbl(txtvaric.Text)
If a <> 0 And b <> 0 And c <> 0 Then
MsgBox "équation du second ordre avec 2 solutions X1 et X2"
lblvaridi.Caption = (b * b) - 4 * a * c
lblvariracdi.Caption = (di) ^ (1 / 2)
If lblvaridi.Caption < 0 Then
MsgBox "2 solutions complexes conjugués"
lblvari1.Caption = (-b - racdi) / (2 * a)
lblvari2.Caption = (-b + racdi) / (2 * a)
Else
MsgBox "2 solutions réels"
lblvari1.Caption = (-b - lblvariracdi.Caption) / (2 * a)
lblvari2.Caption = (-b + lblvariracdi.Caption) / (2 * a)
End If
End If
If a = 0 And b <> 0 And c <> 0 Then
MsgBox "équation du 1er ordre avec 1 solution"
lblvari1.Caption = -c / b
End If
If a = 0 And b = 0 And c <> 0 Then
MsgBox "impossible"
End If
If a = 0 And b <> 0 And c = 0 Then
MsgBox "impossible !! donner une autre valeur à C"
End If
If a <> 0 And b = 0 And c <> 0 Then
lblvaridi.Caption = 0
lblvariracdi.Caption = 0
lblvari1.Caption = 0
lblvari2.Caption = 0
End If
End Sub
Private Sub txtresol1_Click()
End Sub
Private Sub Command1_Click()
txtvaria.Text = ""
txtvarib.Text = ""
txtvaric.Text = ""
lblvari1.Caption = ""
lblvari2.Caption = ""
lblvaridi.Caption = ""
lblvariracdi.Caption = ""
End Sub
Private Sub Command2_Click()
End
End Sub
Dim a, b, c, di, racdi As Double
Private Sub cmdcalcul_Click()
a = CDbl(txtvaria.Text)
b = CDbl(txtvarib.Text)
c = CDbl(txtvaric.Text)
If a <> 0 And b <> 0 And c <> 0 Then
MsgBox "équation du second ordre avec 2 solutions X1 et X2"
lblvaridi.Caption = (b * b) - 4 * a * c
lblvariracdi.Caption = (di) ^ (1 / 2)
If lblvaridi.Caption < 0 Then
MsgBox "2 solutions complexes conjugués"
lblvari1.Caption = (-b - racdi) / (2 * a)
lblvari2.Caption = (-b + racdi) / (2 * a)
Else
MsgBox "2 solutions réels"
lblvari1.Caption = (-b - lblvariracdi.Caption) / (2 * a)
lblvari2.Caption = (-b + lblvariracdi.Caption) / (2 * a)
End If
End If
If a = 0 And b <> 0 And c <> 0 Then
MsgBox "équation du 1er ordre avec 1 solution"
lblvari1.Caption = -c / b
End If
If a = 0 And b = 0 And c <> 0 Then
MsgBox "impossible"
End If
If a = 0 And b <> 0 And c = 0 Then
MsgBox "impossible !! donner une autre valeur à C"
End If
If a <> 0 And b = 0 And c <> 0 Then
lblvaridi.Caption = 0
lblvariracdi.Caption = 0
lblvari1.Caption = 0
lblvari2.Caption = 0
End If
End Sub
Private Sub txtresol1_Click()
End Sub
Private Sub Command1_Click()
txtvaria.Text = ""
txtvarib.Text = ""
txtvaric.Text = ""
lblvari1.Caption = ""
lblvari2.Caption = ""
lblvaridi.Caption = ""
lblvariracdi.Caption = ""
End Sub
Private Sub Command2_Click()
End
End Sub
boudal yassine- Messages : 11
Date d'inscription : 11/04/2009
Age : 34
Localisation : casablanca
Re: résolution des équations du 2nd ordre
merci mais c mieux de poser le code du programmes de TD
Hassan EL GASSIMI- Messages : 11
Date d'inscription : 14/04/2009
Age : 34
Localisation : Mohammedia
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|