Question: Using C++ For this program you are going to create a class that helps to solve the quadratic equation. The equation has the following form:
Using C++
For this program you are going to create a class that helps to solve the quadratic equation. The equation has the following form:
ax2 + bx + c = 0
The roots of the equation are:
x1 = -b + sqrt(b2 - 4 * a * c) and x2 = -b - sqrt(b2 - 4 * a * c)
The phrase in the parenthesis is called the discriminant. If the value of the discriminant is positive, the equation has two roots. If it is zero, the equation has one root. If it is negative, the equation has no roots.
Create a class named Quadratic that finds the roots of a quadratic equation when the coefficients a, b, and c are given.
Hint: You should create three individual coefficient private members.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
