Question: code In python. [1p] Implement class MathematicalExpression that stores a mathematical expression in a text format. [2p] Implement support for the plus operator, where the

 code In python. [1p] Implement class MathematicalExpression that stores a mathematical

code In python.

[1p] Implement class MathematicalExpression that stores a mathematical expression in a text format. [2p] Implement support for the plus operator, where the first argument is always Mathematicalexpression instance and second argument can be either numeric (int, float) or also Mathematicalexpression instance. The result of the addition is a new MathematicalExpression instance. 2. [1p] Implement the equality operator - two Mathematicalexpression instances are equal if and only if the expressions are equal (not only the results). Spaces in the expressions do not matter. 3. [2p] Implement a class IntegerExpression that inherits from MathematicalExpression and which expression can only contain integer numbers (not floating point numbers, i.e. "3+3" not "3.3+3"). Ensure this by raising an appropriate exception. Try to reuse as much code from Mathematicalexpression as possible. Mathematicalexpression example: >> MathematicalExpression("2 +3")== Mathematicalexpression ("2+3") True True

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!