Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please program the following question in C++ Programming Language using Visual Studio 2017 and make sure to include an output in the answer. Create a

Please program the following question in C++ Programming Language using Visual Studio 2017 and make sure to include an output in the answer.

image text in transcribed

Create a class called 'Calculator for infix expression calculation using the two-stack method. This calculator should address the following: 1. Create the stack template for each of your stacks. Use the queue template for any queue like functions that you may need Perform the calculation by first changing the infix expression into post-fix expression. Output to the console the post-fix expression that was generated as well as the result of the expression Then verify your result by repeating the process with converting to a pre-fix expression. Again, output the pre-fix expression to the console 4. Your main should allow the user to enter a mathematical expression of their choice 5. Assume the operands in the input expression will be any-size integer operands but successive operands/operators are separated spaces. Perform adequate expression verification to ensure that it is a well-formed expression before you perform the calculation. If it is mal-formed, inform the user accordingly 6. You should allow all binary arithmetic operators (+,-, *, /, %) and the parentheses 7. Unary operators (negation) in the input expression can be treated as illegal. Negative values calculated during the expression evaluation should be Ok. EXE works from command line on class/lab machines Complete and working MSVC17 solution and proper styling Parsing the input expression to determine it is well-formed Infix to postfix conversion and calculation Infix to prefix conversion and calculation Adequate demonstration of Stack ADT use in main

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

Step: 3

blur-text-image

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions