Question: Create the post - fix expression, based off the above pseudo code in a client file. Create a client _ stack.cpp that will create a
Create the postfix expression, based off the above pseudo code in a client file.
Create a clientstack.cpp that will create a stack object and call your postfix expression function.
This function will receive a string inputted from the user and you will go over each individual character in the string remember strings are just character arrays, you can access the first character by assuming the string is called s s
You can push the character into the stack or change the stack to only accept integers.
Either way you would need to convert the characters into actual integers when doing the mathematical operations using the following process:
char c ;
int num c ;
By subtracting by you will convert any of the number digits character to their actual numeric form.
For the while loop condition:
You can the length function used in string.
int i ;
whilei slength
code for post fix expression
or you can use a for loop to traverse the entire string. Its up to you.
Make sure to throw if an error occurs.
This means you need to use try catch in the clientstack.cpp when calling this function.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
