Java Programs 3 Quadraticooptestjava 5 Points Algebra Solve Quadratic Equations Using Oop Q37158890

Java Programs(3)

QuadraticOOPTest.java (5 points)
Algebra: solve quadratic equations using OOP paradigm. This is amodification
of the HW2 programming question.
The two roots of a quadratic equation ax2 + bx + c = 0 can beobtained using
the following formula:
r1 = −b+p
b2−4ac
2a , r2 = −b−
p
b2−4ac
2a
b2 − 4ac is called the discriminant of the quadratic equation. Ifit is positive,
the equation has two real roots. If it is zero, the equation hasone root. If it is
negative, the equation has no real roots. Note that you can useMath.pow(x,
0.5) to compute p
x.
You need to write the QuadraticOOP class to return the threesolutions (5.0,
-0.3819660112501051, and -2.618033988749895) from a equationx2+3x+1

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.