Programming Questions (50 marks): Q4. In this programming assignment, you will expand and implement the pseudo code discussed in class for an arithmetic calculator
Programming Questions (50 marks): Q4. In this programming assignment, you will expand and implement the pseudo code discussed in class for an arithmetic calculator that uses two different stacks. The expansion will involve inclusion of more binary operators and the parentheses pairs (possibly nested ones). You will implement your code in Java. Your arithmetic calculators must read lines of text from a text file, where each line contains a syntactically correct arithmetic expression. Your output file must repeat the input line and print the computed result on the next line. Your calculators must support the following operators on integers and observe the standard operator precedence as shown in the following (1 to 6: 1 is the highest and 6 is the lowest. Same precedence operators are evaluated from left to right). 1. Parentheses (possibly nested ones): (,) Binary operators: 2. power function: x^y. 3. operators: *,/ 4. operators: +, - 5. operators: >, >,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
To implement part b of your arithmetic calculator in Java you need to use a custom stack implementation not the builtin Java stack Heres a guide on ho...See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started