Answered step by step
Verified Expert Solution
Link Copied!

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:

image text in transcribedPlease, 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=2abb24ac

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the relation of physical mathematics with examples?

Answered: 1 week ago

Question

What are oxidation and reduction reactions? Explain with examples

Answered: 1 week ago