Question: Advance Computer Language - Python and Perl Quadratic Equation Assignment in Python The purposes of this assignment include: passing of parameters and variations of import


Advance Computer Language - Python and Perl Quadratic Equation Assignment in Python The purposes of this assignment include: passing of parameters and variations of import statement. You are to write a program to solve quadratic equations in all their possibilities (real or complex roots, or even degenerate equations). Your program should prompt the user for the 3 coefficients a, b, and c, solve for x and print on stdout. If the solution is complex, the output should consist of a pair of expressions such as 2 + 3i and 2 3i. Other cases will result in either two real numbers being printed, a single real number, or perhaps just a message. You must rename the square root function and use as sqroot You must use subprograms solve_linear, solve_quad, solve_real, and solve_complex Summary of Quadratic Equation Activity Main Program prompt and read input for coefficient a prompt and read input for coefficient b prompt and read input for coefficient c if a is zero o if b is zero display error message (degenerate equation) o otherwise solve linear equation (call solve_linear and send b,c) otherwise o solve quadratic equation (call solve_quad and send a,b,c) solve linear calculate x = -c/b Hint: you may need to use a cast to handle integer division print x solve quad if b2 - 4ac
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
