subject

The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:r1 = (-b + sqrt(b^2 - 4ac)) / (2a)andr2 = (-b - sqrt(b^2 - 4ac)) / (2a)b^2 - 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 that you can use Math. pow(x, 0.5) to compute sqrt(x).Sample Run 1Enter a, b, c: 1.0 3 1The equation has two roots -0.381966 and -2.61803Sample Run 2Enter a, b, c: 1 2.0 1The equation has one root -1

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 02:30
Experimental data that is expressed using numbers is said to be
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
Who can provide you with a new password when you have forgotten your old one? your provide you with a new password in case you forget your old one.
Answers: 3
You know the right answer?
The two roots of a quadratic equation ax^2 + bx + c = 0 can be obtained using the following formula:...
Questions
question
Mathematics, 18.10.2019 10:10
question
Social Studies, 18.10.2019 10:10
Questions on the website: 13722360