+ / \ - + / \ / \ - 4 8 10 / \ 16 5This expression tree represents the arithmetic expression:

((16-5) - 4) + (8+10)which evaluates to

You are given the following class declaration for an expression tree node:

class ExpNode { protected: double value; char operation; bool leaf; ExpNode *left; ExpNode *right; public: ExpNode(double v) : value(v), leaf(true) {} ExpNode(char opn, ExpNode *leftChild, ExpNode *rightChild) : operation(opn), left(leftChild), right(rightChild), leaf(false) {} double evaluate(); };Your task is to write the method named

If the node is a leaf, **evaluate**
will return the number associated with the leaf. Otherwise
**evaluate**will evaluate the left and right subtrees, perform the
operation indicated by the operation field on the results returned by the left and
right subtrees, and return this value.

We have provided a testdriver in main that reads in a prefix arithmetic
expression, constructs an expression tree from it, and calls the root
node's **evaluate** method. Some sample inputs would be:

5 // evaluate should return 5 * 3 4.2 // evaluate should return 12.6 - 4 9 // evaluate should return -5 * + 3 6 4 // evaluate should return 36. The input represents the // expression (3 + 6) * 4 / * 8 5 - 4 2 // evaluate should return 20. The input represents the // expression (8 * 5) / (4 - 2)