Question: Write a program that accepts three doubles from the user (A, B, and C) that are the three coefficients of a quadratic equation. Use the

Write a program that accepts three doubles from the user (A, B, and C) that are the three coefficients of a quadratic equation. Use the quadratic formula to display the root or roots depending on how many there are rounded to two decimal places. If the roots are imaginary (i.e. the discriminate is negative) display so and quit, do not calculate the roots. (Java Programming)

The output look like:

Enter three doubles: 1.0 3.0 -8.0

Roots

-4.70

1.70

Enter three doubles: 1.0 -12.0 36.0

Roots

6.00

Enter three doubles: 6.0 -8.0 81.0

Roots

Imaginary

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!