Java program that involves writing a program to evaluate postfix expressions containing complex numbers using a stack. The algorithm for evaluating a postfix expression requires a stack of complex numbers. The pseudocode for evaluating postfix expressions is given below:
while not end of expression
switch next token
case complex number:
push the value onto the stack
case operator:
pop two operands from the stack
evaluate operation
push result onto the stack
pop the final result off the stack
Each complex number will all be enclosed in a pair of parentheses. The operators permitted include +, - and *. You may assume that all expressions are syntactically correct.
The user should be allowed to enter and evaluate any number of expressions.