Implement an abstract class of geometric shapes Equation;
Define in it a purely virtual function double solve () - finding the root of the equation.
Create on its basis 2 derivatives of the Linear and Trigonometric classes - for linear equations of the form and equations of the form.
For each of these classes, implement the solve function.
Create an array of Equations pointers to Equation.
As a demo, write a program that reads from file N
different equations, creating the corresponding objects and filling them with an array
Equations.
Then calculate the sum of the roots of all the equations.
Input data:
The first line of the input file contains the number N.
The next N lines contain figures.
The first character in the line determines the type of shape (L or T), then the coefficients follow (for linear
equations a, then b).
Output:
In the output file write the sum of the roots up to two decimal places
About the recuiterMember since May 20, 2018 Anurag Nigam
from Bihar, India