infix postfix pain

I need to create a calculator program that converts an infix expression to a postfix expression using the STL class stack to evaluate the postfix expressions. I'm very confused and lost on how to complete this assignment. Here is the test program that will test all of the classes needed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

//Main program infix to postfix
 
#include <iostream>
#include <fstream>
#include <string>
#include "infixToPostfix.h"
 
using namespace std; 

int main()
{
	infixToPostfix  InfixExp;
	string infix = "A/B+C*D/E-(A/((B-C*D)/A)*A);”

		InfixExp.getInfix(infix);
		InfixExp.showInfix();
		InfixExp.showPostfix();
		cout << endl;

	return 0;
}
 


Here is also the template of the final program that it must match.

https://i.imgur.com/hLEZqU0.png
Hello Daerk,

The answer to your question is 42. https://www.youtube.com/watch?v=aboZctrHfK8

You have posted the code for "main" which appears to call member functions of the class, where all the work is done, but you have neglected to post the class definition and its member functions.

With out the code that does the real work how do you expect anyone to answer your question or know what you did.

Andy
I'm very confused and lost on how to complete this assignment


There's absolutely loads of info about doing this available via simple searches on the internet.

Has the algorithm for this (shunting?) been discussed in class?
Topic archived. No new replies allowed.