Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In java please a. Using UML notation, design a class called QuadraticEquation in Microsoft Word to represent a quadractic equation ax2+bx+c=0 The class contains: a.
In java please
a. Using UML notation, design a class called QuadraticEquation in Microsoft Word to represent a quadractic equation ax2+bx+c=0 The class contains: a. Three private double data fields a,b and c to store coefficient of each term of a quadratic equation. b. A constructor with arguments for a,b and c. c. 3 public getter methods to return each value for a,b and c. d. A public method getDiscriminant() to return the discriminant. Formula the discriminant is b24ac e. A public method getRoot1() to return one value of the roots of the quadratic equation. Return 0 if discriminant is negative. f. Another method getRoot2() to return other value of the roots of the quadratic equation. Return 0 if discriminant is negative. Formula for the 2 roots is The roots of a quadratic equation ax2+bx+c=0 are found using x=2abb24acQuadraticFormula Note that in the numerator, there is + and - sign before the square-root sign. So, you can use the + for getRoot1() method and - for getRoot2() method b. Implement your UML design in part (a) above in a Java class. c. Write a test program that will: - Create a QuadraticEquation object and then prompt for a get values for a,b and c - Then display result based on the discriminant. - If discriminant is >0 then display the 2 roots. - If discriminant is 0 then display 1 root. - If discriminant is x2+2x8=0 where a=1,b=2 and c=8 b) x26x9=0 where a=1,b=6 and c=9 c) x2+x6=0 where a=1,b=1 and c=6Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started