Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please, answer the question 3 Test 3(20 points) Classes and Objects. Design a class named QuadraticEquation for a quadratic equation a x2+bx+c=0. The class contains:
Please, answer the question 3
Test 3(20 points) Classes and Objects. Design a class named QuadraticEquation for a quadratic equation a x2+bx+c=0. The class contains: - (3 points)Private data fields a, b, and c that represent three coefficients. - (4 points)A constructor for the arguments for a,b, and c. - (3 points)Three getter methods for a,b, and c. - (4 points)A method named getDiscriminantO that returns the discriminant, which is b24ac. - (6 points)The method named getRoot10 and getRoot20 for returning two roots of the equation. These methods are useful only if the discriminant is nonnegative. Let this methods return 0 if the discriminant is negative. r1=2ab+b24acr2=2abb24acStep 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