Figure 1: This expression is the quadratic formula.
Figure 2: This is the quadratic equation of a parabola. The formula in Figure1 will find the cooridinates where the parabola crosses the X axis
Figure 3: The equation of this parabola is
- If the discriminant in Figure 1 (
$b^2 - 4 a c$ ) is greater than zero, then there will be two real roots - If the discriminant is zero, then there will be one real root
- If the discriminant is less than zero, there will be no real roots
See Figure 3
Figure 4:
Figure 5:
- Compile C++ file and execute the executable from the terminal
g++ quadratic_formula.cpp -o a.out && ./a.out
- Insert the coefficients of the formula
a: <1>
b: <0>
c: <0>
- View the output
root 1: 0
- Compile C++ file and execute the executable from the terminal with the coefficients as arguments
g++ quadratic_formula.cpp -o a.out && ./a.out 1 0 0
- View the output
root 1: 0
The repository contains a file called test_suite.sh which contains a shell script that tests the quadratic root solver, currently test_suite.sh has the test cases hard coded within the file, it would be better for the script to read the test cases from a text file, that way the user coulld easily add their own test cases
./test_suite.sh
Make sure that before any commits are pushed to the repository, that all test cases passed.
TEST-CASE #1 PASSED
TEST-CASE #2 PASSED