Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can some help with the UML. i can build the GUI but not getting my code to function. tired CMSC 350 Project 2 The second
can some help with the UML. i can build the GUI but not getting my code to function. tired
CMSC 350 Project 2 The second programming project involves writing a program that accepts an arithmetic expression of unsigned integers in postfix notation and builds the arithmetic expression tree that represents that expression. From that tree, the corresponding fully parenthesized infix expression should be displayed and a file should be generated that contains the three address format instructions. This topic is discussed in the week 4 reading in module 2, section II-B. The main class should create the GUI shown below: Three Adddress Generator Enter Postfix Expression | 3 5 9 2 3 Construct Tree Infix Expression ((3-(5 9))/(2 3) The GUI must be generated by code that you write. You may not use a drag-and-drop GUI generator Pressing the Construct Tree button should cause the tree to be constructed and using that tree, the corresponding infix expression should be displayed and the three address instruction file should be generated The postfix expression input should not be required to have spaces between every token. Note in the above example that 9+- are not separated by spaces The above example should produce the following output file containing the three address instructions: R0 5 9 Add Sub R1 3 RO Mul R2 2 3 Div R3 R1 R2 It is not necessary to reuse registers within an expression as shown in module 2, section II-B, and you can assume there are as many available as needed. Each new expression should, however, begin using registers starting at RO Inheritance should be used to define the arithmetic expression tree. At a minimum, it should involve three classes: an abstract class for the tree nodes and two derived classes, one for operand nodes and another for operator nodes. Other classes should be included as needed to accomplish good object-oriented design. All instance data must be declared as private. You may assume that the expression is syntactically correct with regard to the order of operators and operands, but you should check for invalid tokens, such as characters that are not valid operators or operands such as 2a, which are not valid integers. If an invalid token is detected aStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started