Question: code im java please!!! Problem 21 Define the class Quadratic that has the following data fields and methods. Data fields: Instance data fields: a, b,

code im java please!!! code im java please!!! Problem 21 Define the class Quadratic that has

Problem 21 Define the class Quadratic that has the following data fields and methods. Data fields: Instance data fields: a, b, and c of type double. These variables store the coefficients of a quadratic equation of the form a *x*x+bx+c. Methods: An empty no-arg constructor. A constructor that takes three arguments, sets the instance data fields to the taken arguments. Quadratic(double aVal, double bVal, double eVal) } o A void method named setA that sets the value of the instance data field a to the value provided as an argument. A void method named set that sets the value of the instance data field b to the value provided as an argument. o A void method named set that sets the value of the instance data field c to the value provided as an argument void setC(double Value) A method that checks whether the equation has two real roots. If Vb2 - 4ac 20, the equation has two real roots and the method returns truc, otherwise it returns false. boolean hasRealRoots() { } A method that evaluates the equation at a given point x. The method returns the result of evaluating this equation at a given point x (a****+ bx + c), with x given as an argument. For example, if a -2, b = 1, and c = 1 and x = 3, the method returns 20 (2*3*3 + 1*3 -1 -20). double evaluateQuadratic(double x){ } Extra credit: 10%. A method that returns an array of size 2 that contains the real roots of this quadratic equation. The two roots of the equation are given as follows -4ae Vac 20 double[getRoots() { A method that displays this object in a format of your choice. void printQuadratico Create a test class named TestQuadratic to test the class Quadratic and sketch the UML class model of the Quadratic class. The UML should be submitted either as an image or a word file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!