Professional Documents
Culture Documents
Act 3 - Mathematical Operators
Act 3 - Mathematical Operators
At the end of this activity, students will be able create a C++ program that would
perform calculation using c++ built-in mathematical operators.
Examples: 5𝑥 2 + 6𝑥 + 2 = 0 ; a = 5, b = 6, c = 2
𝑥 2 − 7𝑥 + 20 = 0 ; a = 1, b = 7, c = 20
34𝑥 2 + 16 = 0 ; a = 34, b = 0, c =16
−𝑏 + √𝑏2 − 4𝑎𝑐
Root 1 =
2𝑎
−b − √𝑏2 − 4𝑎𝑐
Root 2 =
2𝑎
Requirements Create a C++ program that allows user to input for the value of a, b, and c of the
quadratic equation. Compute and display the two roots of the equation
Test Case