Problem

(Algebra: solve quadratic equations) The two roots of a quadratic equation ax2 + bx + x =...

(Algebra: solve quadratic equations) The two roots of a quadratic equation ax2 + bx + x = 0 can be obtained using the following formula:

Write a function with the following header

void solveQuadraticEquation( double a, double b, double c, double& discriminant, double & r1 ,double & r2)

b2 − 4ac is called the discriminant of the quadratic equation. If the discriminant is less than 0 , the equation has no roots. In this case, ignore the value in r1 and r2.

Write a test program that prompts the user to enter values for a , b , and c and dis;plays the result based on the discriminant. If the discriminant is greater than or equal to 0, display the two roots. If the discriminant is equal to 0 , display the one root. Otherwise, display "the equation has no roots". See Programming Exercise for sample runs.

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 6
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