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 post-fix expression, based off the above pseudo code in a client file.
Create a client_stack.cpp that will create a stack object and call your post-fix 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[0].
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 (0,1,2,3,4,5,6,7,8,9) into actual integers when doing the mathematical operations using the following process:
char c =5;
int num = c 0;
By subtracting by 0, 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 =0;
while(i < s.length())
{
//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 client_stack.cpp when calling this function.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!