Vladislav
21st March 2007, 07:55
Dunno if this is the right forum.Sorry if it's not.
Well the time has come for me to beg someone to do my homework for me. Not really, but I do need some help.
I have this major project due this Friday and I've hit a dead end.
This is the project:
A quadratic equation has the form y=ax2 + bx + c.
Develop a program to find the roots of any equation of this form. Your application should allow its user to type in the equation. It should provide users with feedback if the equation they enter is not valid. eg. b^2 - 4ac , can not be negative. Include error checking routines and help system.
Once the equation has been validated it should graph the quadratic equation.
I've done the first part of the code, but I have no idea how to graph it.
If anyone is willing to help then please do.If I get no reply then I'll just make some shit up and hand that in. Thanks in advance.
edit: This is the coding that I've done:
Private Sub cmdCalc_Click()
A = Val(txtA.Text)
b = Val(txtB.Text)
c = Val(txtC.Text)
f = Val((b ^ 2) - (4 * A * c))
g = Val((b ^ 2) - (4 * A * c))
j = Val(A)
If j = Val(0) Then
lblData1.Caption = "Not a quadratic equation. 'A' cannot equal 0."
Else
If Val(g) = 0 Then
d = Val(((-b + Sqr((b ^ 2) - (4 * A * c)))) / (2 * A))
e = Val(((-b - Sqr((b ^ 2) - (4 * A * c)))) / (2 * A))
lblAxa.Caption = d
lblAxb.Caption = e
Else
If Abs(g) = Val(-1 * g) Then
lblAxa.Caption = "imaginary"
lblAxb.Caption = "imaginary"
lblData1.Caption = "Imaginary numbers."
Else
d = Val(((-b + (((b ^ 2) - (4 * A * c)) ^ (1 / 2)))) / (2 * A))
e = Val(((-b - (((b ^ 2) - (4 * A * c)) ^ (1 / 2)))) / (2 * A))
lblAxa.Caption = d
lblAxb.Caption = e
End If
End If
End If
End Sub
Private Sub cmdClear_Click()
txtA.Text = ""
txtB.Text = ""
txtC.Text = ""
lblAxa.Caption = ""
lblAxb.Caption = ""
lblData1.Caption = ""
txtA.SetFocus
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Form_Load()
End Sub
Well the time has come for me to beg someone to do my homework for me. Not really, but I do need some help.
I have this major project due this Friday and I've hit a dead end.
This is the project:
A quadratic equation has the form y=ax2 + bx + c.
Develop a program to find the roots of any equation of this form. Your application should allow its user to type in the equation. It should provide users with feedback if the equation they enter is not valid. eg. b^2 - 4ac , can not be negative. Include error checking routines and help system.
Once the equation has been validated it should graph the quadratic equation.
I've done the first part of the code, but I have no idea how to graph it.
If anyone is willing to help then please do.If I get no reply then I'll just make some shit up and hand that in. Thanks in advance.
edit: This is the coding that I've done:
Private Sub cmdCalc_Click()
A = Val(txtA.Text)
b = Val(txtB.Text)
c = Val(txtC.Text)
f = Val((b ^ 2) - (4 * A * c))
g = Val((b ^ 2) - (4 * A * c))
j = Val(A)
If j = Val(0) Then
lblData1.Caption = "Not a quadratic equation. 'A' cannot equal 0."
Else
If Val(g) = 0 Then
d = Val(((-b + Sqr((b ^ 2) - (4 * A * c)))) / (2 * A))
e = Val(((-b - Sqr((b ^ 2) - (4 * A * c)))) / (2 * A))
lblAxa.Caption = d
lblAxb.Caption = e
Else
If Abs(g) = Val(-1 * g) Then
lblAxa.Caption = "imaginary"
lblAxb.Caption = "imaginary"
lblData1.Caption = "Imaginary numbers."
Else
d = Val(((-b + (((b ^ 2) - (4 * A * c)) ^ (1 / 2)))) / (2 * A))
e = Val(((-b - (((b ^ 2) - (4 * A * c)) ^ (1 / 2)))) / (2 * A))
lblAxa.Caption = d
lblAxb.Caption = e
End If
End If
End If
End Sub
Private Sub cmdClear_Click()
txtA.Text = ""
txtB.Text = ""
txtC.Text = ""
lblAxa.Caption = ""
lblAxb.Caption = ""
lblData1.Caption = ""
txtA.SetFocus
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub Form_Load()
End Sub