Problem

(Quadratic formula) The formula that calculates roots for a quadratic equation ax2 + bx +...

(Quadratic formula) The formula that calculates roots for a quadratic equation ax2 + bx + c is the quadratic formula . Because the square root of a negative is imaginary, one can use the expression under the square root (known as the discriminant) to check for the type of root. If the discriminant is negative, the roots are imaginary. If the discriminant is zero, there is only one root. If the discriminant is positive, there are two roots.

(a) Write a program that uses the quadratic formula to generate real roots, i.e., ignores the imaginary roots. Use the discriminant to determine whether there is one root or two roots and then print the appropriate answer.

(b) Python uses the letter “j” to represent the mathematical imaginary number “i” (a convention used in electrical engineering). However, the Python “j” must always be preceeded by a number. That is, “1j” is equivalent to the mathematical “i.” Add the ability to handle imaginary roots to your program.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 2
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT