Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions