*3.1 (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following formula: --b + vb? – 4ac and r2 -b - V – 4ac 2a 2a b² – 4ac is...


Code necessary to run program?


*3.1<br>(Algebra: solve quadratic equations) The two roots of a quadratic equation<br>ax? + bx + c = 0 can be obtained using the following formula:<br>--b + vb? – 4ac<br>and r2<br>-b - V – 4ac<br>2a<br>2a<br>b² – 4ac is called the discriminant of the quadratic equation. If it is positive, the equation<br>has two real roots. If it is zero, the equation has one root. If it is negative, the equation<br>has no real roots.<br>Write a program that prompts the user to enter values for a, b, and c and displays the<br>result based on the discriminant. If the discriminant is positive, display two roots. If the<br>discriminant is 0, display one root. Otherwise, display
"/>
Extracted text: *3.1 (Algebra: solve quadratic equations) The two roots of a quadratic equation ax? + bx + c = 0 can be obtained using the following formula: --b + vb? – 4ac and r2 -b - V – 4ac 2a 2a b² – 4ac is called the discriminant of the quadratic equation. If it is positive, the equation has two real roots. If it is zero, the equation has one root. If it is negative, the equation has no real roots. Write a program that prompts the user to enter values for a, b, and c and displays the result based on the discriminant. If the discriminant is positive, display two roots. If the discriminant is 0, display one root. Otherwise, display "The equation has no real roots." Note you can use Math.pow (x, 0.5) to compute VT. Sample Run for Exercise03_01.java Enter input data for the program (Sample data provided below. You may modify it.) 13.5 45.2 12.4 Show the Sample Output Using the Preceeding Input Reset Execution Result: Enter a, b, c: 13.5 45.2 12.4 The equation has two roots -0.3014832803673518 and -3.046664867780797 JDK8>

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here