Question: Using Java and the Stack Interface, create a postfix calculator that reads in the whole expression (5 6 + 8 3 - *) and evaluates

Using Java and the Stack Interface,

create a postfix calculator that reads in the whole expression (5 6 + 8 3 - *) and evaluates it. This calculator should also accept multi-digit numbers. Use double instead of int

Sample expressions to use: Regular and postfix expressions should be the same exact expressions, I apologize if I converted to postfix incorrectly

Regular notation:

(55 - 2) + 4 * 6 / 2

(2 - 5) * 4

4 * 3 / 2.0 - 62

Postfix

55 2 - 4 6 * 2 / +

2 5 - 4 *

4 3 * 2.0 / 62 -

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!