Write code and also share output screen. Thanks
I need help creating a program in C++ that uses STACK abstract data type. The equations need to be simple (only use addition, subtraction, multiplication or division) and all inputs should be strings. Please be sure to validate the operands and operators as well as convert the operands into numbers (using stod() function). Here is the criteria:
- Ask the user to enter the option to pick between infix, prefix, or postfix (user will select infix first).
- Allow the user to enter a mathematical expression per the option above.
- Then allow the user to enter the option to pick between infix, prefix, or postfix a second time (user will select prefix this time).
- Ensure that the user does not pick the same exact option again.
- Validate that the expression entered is correct per the option picked in step 1.
- Evaluate the expression entered per the option selected in step 1.
- Display the value produced in the above step.
- Convert the expression to be represented per the option picked in step 3.
- Display the new expression after being converted in the above step.
- Evaluate the expression after being converted.
- Display the value produced in the above step
230,453 students got unstuck by Course
Hero in the last week
Our Expert Tutors provide step by step solutions to help you excel in your courses