Write a class for linear equations. A generic linear equation is of the form y = mx + b where m and b are constants. Include the following methods:
(a) __
init__ ,__str__ , __repr__ .(b)
value(x), which returns the value of the equation givenx.(c) compose(
LinearEquation) that composes two linear equations. That is, if y = x +1 and z = 2a +5, then y(z) = 2x + 6 and will be called asy.compose(z).Note that the compose operation is not commutative.
(d) __add__ returns the sum of two linear equations. That is, if y = ax + b and z = cx + d, then y + z= (a + c)x + (b + d).
Include sample code that uses your class and demonstrates the use of all methods as well as error handling.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.