write a program that solves a quadratic equation in all cases. Set up the follow
ID: 642987 • Letter: W
Question
write a program that solves a quadratic equation in all cases.
Set up the following classes: Complex: which encapsulates a complex number, Complex Pair: which encapsulates a pair of complex numbers,Quadratic: which encapsulates a quadratic equation,Solve Equation: which contains the main method.
Along with the usual constructors, accessors and mutators, you will need to code the additional methods.
In Complex class: a method that determines whether a complex object is real
In the Complex pair class: a method that determines whether both complex numbers are identical
In the Quadratic class: a method to solve the quadratic equation and return a ComplexPair object.
Additionally, you need to include code in the main method that solve several examples of quadratic equations input from the keyboard.
Your output should make comments as to what type of roots we get ( double root, distinct real roots, distinct complex root).
You should check that your code works in all four basic cases:
? The quadratic equation is actually a linear equation
? Both roots are complex
? There is a double real root
? There are 2 distinct real roots.
I am new at Java programming, please help me!!!!!! thank you
Explanation / Answer
Quadratic Class
ComplexPair Class
Complex Class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.