The first programming project involves writing a program that converts prefix expressions to postfix and postfix expressions to prefix. Customary infix expression place the operator between the two operands. In a prefix expression, the operator comes before the two operands. In a postfix expression it comes after them. One benefit of prefix and postfix expressions is that they never require parentheses nor rules regarding precedence or associativity.
The program for this project should consist of three classes. The main class should create a GUI that allows the user to input an expression in either prefix or postfix and convert it to postfix or prefix, respectively. The GUI should look as follows:
The GUI must be generated by code that you write. You may not use a drag-and-drop GUI generator.
The second class should contain the code to perform the conversions. The pseudocode for prefix to postfix, which
requires two stacks, is shown below:
Get Free Quote!
298 Experts Online