Step 3 The RPN Calculator By now you should have a working stack and queue. Use the Stack to create an RPN calculator. Y

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Step 3 The RPN Calculator By now you should have a working stack and queue. Use the Stack to create an RPN calculator. Y

Post by answerhappygod »

Step 3 The Rpn Calculator By Now You Should Have A Working Stack And Queue Use The Stack To Create An Rpn Calculator Y 1
Step 3 The Rpn Calculator By Now You Should Have A Working Stack And Queue Use The Stack To Create An Rpn Calculator Y 1 (97.42 KiB) Viewed 32 times
Step 3 The RPN Calculator By now you should have a working stack and queue. Use the Stack to create an RPN calculator. You will have to make a decision whether you want to use inheritance or simple composition to make the RPN calculator work. You will also have to make a decision as to what the interface into the RPN calculator is. One of the things that needs to be considered is parsing the input. We know that an RPN calculator will operate on an expression like so: 325* + but what happens if someone puts more that one space in between each token of the input? You will need to handle something things like: 2 5 3 What you should do is allow the interface to take a string type and then parse the tokens out of the string. Step 4 Infix Notation Calculator Infix notation is an expression like this: 3 + 2*5 In this step you are to create a calculator that allows for expression like the above. Your calculator should support +, -, *, /. This is an extremely difficult thing to solve because we need to consider the operator precedence. The best way to solve the problem is to convert the infix to postfix (RPN). You may be wondering how to convert from infix to postfix. Well, there are several algorithms out there that you can find but I have included an algorithm and source code written in C#. You can read about the algorithm and download the code here. Your infix notation calculator must be derived from RPN Calculator. In my mind you are going to want to use the input parser and the RPN algorithm once the infix has been converted to postfix.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply