Write down a java multithreaded program to get three or more complex mathematical expression as a input
Question:
Write down a java multithreaded program to get three or more complex mathematical expression as a input which must have at least one addition operation, one subtraction operation, one multiplication operation other than these operations, it has to throw your own custom defined exception namely, UnSupportedOperatorException. Implement each operation as separate thread and evaluate the expression as per the operator precedence by calling the appropriate thread. Final answer must be in two decimal digits precision.
INPUT Format:
x = (5+6) - (7/6)*1
NOTE: Firstly, the operators and operands from parenthesis must be extracted then call the appropriate function to get the intermediate result and proceed further until the evaluation of the expression getting finished. For this input, firstly it has to identify the given expression contains two parenthesis viz(5+6) and (7/6), then it extracts the operands 5, 6 + and 7, 6,// next, it has to call the addition operation and pass 5 and 6 as arguments, get 11 as intermediate result. Similarly for division operation it has to pass 7 and 6 and the intermediate result as 1.17. Finally, apply the subtraction operation 11-1.17 = 9.83.
output Format:
9.83...
Auditing Cases An Interactive Learning Approach
ISBN: 978-0132423502
4th Edition
Authors: Steven M Glover, Douglas F Prawitt