Question: Write a C++ program (without a use of global variables) to solve a single quadratic equation of the form:
a*x2 +b*x+c=0
with the following specific requirements:
Part 1) Reading of coefficients a, b, c shall be done by a function named readCoeffs(). They shall be entered
as double's from the keyboard by an operator, after prompt, as follows:
Enter coefficient a:
Enter coefficient b:
Enter coefficient c:
and returned to the caller as a structure with 3 fields.
Part 2) The actual solution of the equation shall be done by a function named equSolver(), which takes three coefficients as parameters and returns a structure of three fields: two roots (if they exist) and a boolean indicator, whether the roots do exist.
Part 3) The function equSolver() shall call another function named discr() to calculate and return the discriminant necessary to compute the roots.
Part 4) After equation is solved, another function named outResults() shall display on the screen results of the calculation in the following format:
1. a) If the solutions (roots) exist in the real domain, the output shall look as follows:
2. Quadratic equation with the following coefficients:
3. a: ; b: ; c:
4. has the following roots
5. Root1: ; Root2: ;
6.
7. b) In case there are no solutions (roots) in the real domain, the output shall look as follows:
Quadratic equation with the following coefficients: a: ; b: ; c: has no roots in the real domain.
Part 5) All functions shall be placed in a file separate from main(), named funcs.cpp, and a makefile shall be constructed and used for compilation.
Please show me all the working and provide the answer.