Try to run this full program and u will see that it has few errors.
I would be grateful if u included corrected in an answer post.
It is in VB 5.
Thanks for your attention.
Private Sub Command1_Click( )
Dim x, y, z, w, v, a, b As Double
MsgBox "give a"
InputBox a
MsgBox "give b"
InputBox b
If a = 0 Or b = 0 Then
MsgBox "The solutions can not be given by that program!"
Else
MsgBox "ok please wait...."
End If
If a ^ 4 - (256 * b ^ 3) / 27 >= 0 Then
z = ((a ^ 2 + (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3 + ((a ^ 2 - (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3
Else
MsgBox "The solutions can not be given by that program!"
End If
If z >= 0 And -z - (2 * a) / z ^ 1 / 2 >= 0 Then
x = (z ^ 1 / 2 + (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
w = (z ^ 1 / 2 - (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z >= 0 And -z + (2 * a) / z ^ 1 / 2 >= 0 Then
y = (z ^ 1 / 2 + (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
v = (z ^ 1 / 2 - (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z < 0 Then
MsgBox "There are no other real solutions"
End If
MsgBox "The first solution is" 'x'
MsgBox "The second solution is" 'w'
MsgBox "The third solution is" 'y'
MsgBox "The fourth solution is" 'v'
MsgBox "There is no other real solution"
MsgBox "Thanks for using that program"
End
...
...
End sub
I would be grateful if u included corrected in an answer post.
It is in VB 5.
Thanks for your attention.
Private Sub Command1_Click( )
Dim x, y, z, w, v, a, b As Double
MsgBox "give a"
InputBox a
MsgBox "give b"
InputBox b
If a = 0 Or b = 0 Then
MsgBox "The solutions can not be given by that program!"
Else
MsgBox "ok please wait...."
End If
If a ^ 4 - (256 * b ^ 3) / 27 >= 0 Then
z = ((a ^ 2 + (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3 + ((a ^ 2 - (a ^ 4 - (256 * b ^ 3) / 27) ^ 1 / 2) / 2) ^ 1 / 3
Else
MsgBox "The solutions can not be given by that program!"
End If
If z >= 0 And -z - (2 * a) / z ^ 1 / 2 >= 0 Then
x = (z ^ 1 / 2 + (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
w = (z ^ 1 / 2 - (-z - (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z >= 0 And -z + (2 * a) / z ^ 1 / 2 >= 0 Then
y = (z ^ 1 / 2 + (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
v = (z ^ 1 / 2 - (-z + (2 * a) / z ^ 1 / 2) ^ 1 / 2) / 2
Else
If z < 0 Then
MsgBox "There are no other real solutions"
End If
MsgBox "The first solution is" 'x'
MsgBox "The second solution is" 'w'
MsgBox "The third solution is" 'y'
MsgBox "The fourth solution is" 'v'
MsgBox "There is no other real solution"
MsgBox "Thanks for using that program"
End
...
...
End sub
Comment