Write a command line calculator that supports exponentiation (^ symbol), multiplication, division, addition and subtraction.
1. Write a program called "Calculator" that reads input from user as a string until the input is "exit". Use a prompt (examples: >> , --> ) for user input.
2. Split the string into an array of Strings (or "tokens").
3. Write a subroutine that takes a String and returns whether or not it is a valid Operand/number
4. Write a subroutine that takes a String and returns whether or not it is a valid Operator (valid operators are, in order of precedence, ^, *, /, +, - where '^' is exponentiation.
5. Write a subroutine that checks to see if the Array of Strings is a complete, valid expression.
1. Complete NumberNode.java (write the constructors)
2. Complete OperatorNode.java (constructs, getters and setters)
3. Write OperatorNode's value() function. This is a big one!
1. Write a subroutine in Calculator.java that accepts a String representing an operator and returns an integer representing its priority number. (use ArrayLists's indexOf() method).
2. Write a subroutine in Calculator.java that accepts the String array representing the whole expression, that will build an Expression Tree and return its root node. THE OTHER BIG ONE!
3. Finish Calculator.java. If the expression is valid (you wrote a subroutine for that), pass the expression String Array to the Expression Builder which will return the ENode root of the tree.
4. Get the value of the root ENode and print this to the screen as the final calculation.
5. Submit Calculator.java, NumberNode.java and OperatorNode.java