Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, can someone please let me know how to to this program in c++ For this assignment, you are to write a program, which will

Hi, can someone please let me know how to to this program in c++

For this assignment, you are to write a program, which will calculate the results of Reverse Polish expressions that are provided by the user. You must use a linked list to maintain the stack for this program (array implementations of the stack will not receive full credit). You must handle the following situations (errors): Too many operators (+ - / *) Too many operands (doubles) Division by zero The program will take in a Polish expression that separates the operators and operands by a single space, and terminates the expression with an equals sign. The program will continue to take and evaluate expressions until the user enters a zero (0) on a line by itself followed by a new line. Your sample output should show the handling of all the error conditions as well as make use of all of the operators. Sample IO: (note: formatting of output isnt a critical issue but proper input processing is essential) Input Output 10 15 + = 25 10 15 - = -5 2.5 3.5 + = 6 (or 6.0) 10 0 / = Error: Division by zero 10 20 * / = Error: Too many operators 12 20 30 / = Error: Too many operands -10 -30 - = 20 100 10 50 25 / * - -2 / = -40 Turning in the assignment: I need a file of the source code, including the output, and the .exe file. Copy the output and place this as a comment at the bottom of your source code.

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

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions