Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A quadratic equation is a polynomial equation of degree 2, commonly written in t

ID: 3629338 • Letter: A

Question

A quadratic equation is a polynomial equation of degree 2, commonly written in the form p(x) = ax2 + bx + c, where x is a variable and a, b, c are called the coefficients of the equation. A homogeneous quadratic equation is one that is set equal to 0, e.g., p(x) =3.1x2 + 2x ? 5 = 0. Note that the coefficients in this problem are positive or negative real numbers (they could be complex numbers, but we will assume they are real numbers). If x is a real number and p(x) is 0 then x is called a root of the equation. In general, a polynomial of degree n (the degree of a polynomial equation is the value of the largest exponent) will have n roots, so a quadratic
equation will have two roots. However, depending on the values of the coefficients, some or all of these roots may be complex (i.e.,not real numbers). The well-known quadratic formula can be used to determine the two real roots of a quadratic equation—if they exist,The b2 ? 4ac term under the radical is called the discriminant, and if the discriminant is greater than or equal to zero, then both roots
are real. A sample run is shown below. Your program should be similar (user input is shown in bold).
Enter coefficient a: 2.5
Enter coefficient b: 6.7
Enter coefficient c: -3
2.5x^2 + 6.7x + -3 = 0
Root1 = 0.39078
Root2 = -3.07078

Implement the following pseudocode.

Include necessary header files
Function discriminant ( Input: a is Double, b is Double, c is Double ) Returns Double
Return b2 - 4ac
End Function discriminant
Function root1 ( Input: a is Double, b is Double, c is Double ) Returns Double
disc ? discriminant ( a, b, c )
Return [ -b + sqrt ( disc ) ] / ( 2a )
End Function root1
Function root2 ( Input: a is Double, b is Double, c is Double ) Returns Double
disc ? discriminant ( a, b, c )
Return [ -b - sqrt ( disc ) ] / ( 2a )
End Function root2
Function display_eqn ( Input: a is Double, b is Double, c is Double ) Returns Nothing
Display a "x^2 + " b "x + " c " = 0"
End Function display_eqn
Function main ( Input: Nothing )
Define necessary variables
Display prompt "Enter coefficient for a: "
a ? Read real number
Display prompt "Enter coefficient for b: "
b ? Read real number
Display prompt "Enter coefficient for c: "
c ? Read real number
r1 ? root1 ( a, b, c )
r2 ? root2 ( a, b, c )
Call display_eqn ( a, b, c )
Display "Root1 = " r1
Display "Root2 = " r2
End Function main

Explanation / Answer

Dear Friend PLEASE RATE #include #include using namespace std; int main() { float a,b,c,d,root1,root2; cout >b>>c; if(!a){ if(!b) cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote