PYTHON Programming: A quadratic equation (Links to an external site.) can be given in the form of ax2 + bx + c = 0 where
Posted: Sun May 15, 2022 12:43 pm
PYTHON Programming:
A quadratic equation (Links to an external site.) can be given
in the form of ax2 + bx + c = 0 where a, b, c are real numbers and
x is the independent variable. A given quadratic equation
(b2 - 4ac) has real roots only when the discriminant of the
quadratic equation, is greater than or equal to zero. Write a
Python function named, prg_question_2 to check whether a given
quadratic equation in above form with given parameters, a, b, c has
real roots.
Do the following:
1.Write only the algorithm as code comments (2 points)
2.Implement your function (5 points)
3. Test your function for the equations, x2 + 5x + 6 = 0 and x2
+ x + 1 = 0 (3 points)
A quadratic equation (Links to an external site.) can be given
in the form of ax2 + bx + c = 0 where a, b, c are real numbers and
x is the independent variable. A given quadratic equation
(b2 - 4ac) has real roots only when the discriminant of the
quadratic equation, is greater than or equal to zero. Write a
Python function named, prg_question_2 to check whether a given
quadratic equation in above form with given parameters, a, b, c has
real roots.
Do the following:
1.Write only the algorithm as code comments (2 points)
2.Implement your function (5 points)
3. Test your function for the equations, x2 + 5x + 6 = 0 and x2
+ x + 1 = 0 (3 points)