(Algebra: solve quadratic equations) Write a function for solving a quadratic equation using the following header:
def solveQuadratic(eqn, roots):
The coefficients of a quadratic equation are passed to the list eqn and the noncomplex roots are stored in roots. The function returns the number of roots. See Programming Exercise 4.1 on how to solve a quadratic equation.
Write a program that prompts the user to enter values for a, b, and c and displays the number of roots and all noncomplex roots.
Sorry the answer is not available at the moment…
If you are able to find the answer, please make sure to post it here. So that your Juniors have smile on their lips and feel happy.
Spread the 'tradition of sharing'.