1. Extend the Arithmetic example from the course notes to include classes Minus, Mult and Divide. Each of these should override the eval() method to perform the correct operations. For each class, including the ones I've already provided, write a toString() method that returns a String containing a text version of the part of the arithmetic problem in the subtree rooted at the current node. For example, if the expression tree is 0 0 o ooo calling toString() for the "+" node should produce the String ((3 * 5) + (1/4)). The recommended way to do this is the same as the way the eval() method works: recursively. For example, if the top node is a Plus object, it creates a String with an opening parenthesis "C, then calls its left child to return a String (which is then concatenated), then concatenates " + , then calls its right child to return a string (which is concatenated), then concatenates")". The method toString() returns the resultant String. Rewrite the TestArithmetic class so that its main() method produces five random arithmetic problems of opening parenthesis C, then calls its left child to return a String (which is then concatenated), then concatenates + , then calls its right child to return a string (which is concatenated), then concatenates)". The method toString() returns the resultant String. Rewrite the TestArithmetic class so that its main() method produces five random arithmetic problems of length four (i.e., having four Consts separated by three operators). Constants should be integers chosen at random in the range [1, 20). Operators should be chosen randomly from the set {+, -, *,1}. For each arithmetic problem, you should print out the result of your toString() method applied to the root node, then an equals sign, then the result of eval(), producing something like this: ((16.0/ 16.0) - (7.0 * 17.0)) = -118.0 ((4.0+ 17.0)/(12.0/ 12.0)) = 21.0 (14.0 - 4.0) + (1.0 / 20.0)) = 10.05 ((18.0 + 15.0)/(5.0/ 10.0)) = 66.0 ((4.0/5.0) + (5.0 * 7.0)) = 35.8 You might find it convenient (as I did) to create methods randOperator () and randConstant () within TestArithmetic. You should submit your .java files to D2L. 1. Extend the Arithmetic example from the course notes to include classes Minus, Mult and Divide. Each of these should override the eval() method to perform the correct operations. For each class, including the ones I've already provided, write a toString() method that returns a String containing a text version of the part of the arithmetic problem in the subtree rooted at the current node. For example, if the expression tree is 0 0 o ooo calling toString() for the "+" node should produce the String ((3 * 5) + (1/4)). The recommended way to do this is the same as the way the eval() method works: recursively. For example, if the top node is a Plus object, it creates a String with an opening parenthesis "C, then calls its left child to return a String (which is then concatenated), then concatenates " + , then calls its right child to return a string (which is concatenated), then concatenates")". The method toString() returns the resultant String. Rewrite the TestArithmetic class so that its main() method produces five random arithmetic problems of opening parenthesis C, then calls its left child to return a String (which is then concatenated), then concatenates + , then calls its right child to return a string (which is concatenated), then concatenates)". The method toString() returns the resultant String. Rewrite the TestArithmetic class so that its main() method produces five random arithmetic problems of length four (i.e., having four Consts separated by three operators). Constants should be integers chosen at random in the range [1, 20). Operators should be chosen randomly from the set {+, -, *,1}. For each arithmetic problem, you should print out the result of your toString() method applied to the root node, then an equals sign, then the result of eval(), producing something like this: ((16.0/ 16.0) - (7.0 * 17.0)) = -118.0 ((4.0+ 17.0)/(12.0/ 12.0)) = 21.0 (14.0 - 4.0) + (1.0 / 20.0)) = 10.05 ((18.0 + 15.0)/(5.0/ 10.0)) = 66.0 ((4.0/5.0) + (5.0 * 7.0)) = 35.8 You might find it convenient (as I did) to create methods randOperator () and randConstant () within TestArithmetic. You should submit your .java files to D2L