Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

SECOND VERSION NEEDED!!!!! JAVA CODE PLEASE!!!!!!! In class, we discussed about Evaluating Arithmetic Expressions (ref. Class slides and the text book). In this programming assignment,

SECOND VERSION NEEDED!!!!! JAVA CODE PLEASE!!!!!!!image text in transcribed

In class, we discussed about Evaluating Arithmetic Expressions (ref. Class slides and the text book). In this programming assignment, you will design, using pseudo code, and implementation in Java code, two versions of arithmetic calculators. The first version will be based on the pseudo code discussed in class that uses two different stacks. The second version must be based on recursion. This means that you have to replace the explicit use of stacks in the first version) by using recursion (that implicitly uses the JVM runtime stack). 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 integer or real numbers and observe the standard operator precedence as shown below (1-8, highest to lowest; same precedence evaluated left to right). 1. Parentheses (possibly nested ones): (,) unary operators 2. factorial: ! 3. minus: - binary operators 4. power function: x 5. operators: *,1 6. operators: +,- 7. operators: >,>,,>,

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Privacy In Statistical Databases International Conference Psd 2022 Paris France September 21 23 2022 Proceedings Lncs 13463

Authors: Josep Domingo-Ferrer ,Maryline Laurent

1st Edition

3031139445, 978-3031139444

More Books

Students also viewed these Databases questions

Question

What are the purposes of promotion ?

Answered: 1 week ago