Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise2: Write the program to the roots of quadratic equation. You may assume the x2 co-efficient is not zero. If the discriminate is negative display

Exercise2: Write the program to the roots of quadratic equation. You may assume

the x2

co-efficient is not zero. If the discriminate is negative display message stating

that there are no solutions.

For the above said question, create a class QuadarticEquation which has three

instance variable of type int and performs the following.

a) Provide a constructor that receives the co-efficients for three variables of the

quadratic equation and initializes the instance variables.

b) Provide a static method name roots to calculate and display the roots of the

equation.(Hint: ,use sqrt method which is Math class)

Create a class QuadraticEquationTest and performs the following.

a. Prompt the user to read values for a, b and c.

b. Create an object for the class QuadraticEquation

c. Call the method roots using the class name.

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

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions

Question

Were the right people involved in the decision-making process?

Answered: 1 week ago

Question

Were they made on a timely basis?

Answered: 1 week ago