Project 1

advertisement
Project 1
Work in seven groups formed in Tuesday class. Each group should consist of 3 – 4 members.
Each group designs an algorithm creates expression tress from infix expression.
The input is infix expression contains operands, such as a, b, c …, and operators +, -, *, /, ( and ).
The output is expression tress as example Figure 4.14 on page 109.
Phase I: Each group hand-in a design report on Feb 9 (next Tuesday)
1. Briefly describe the algorithm;
2. Pseudocode in Java style syntax;
3. Hand trace of two test cases to show your algorithm works.
Phase II: Each group hand-in a printout contains source code, documentation (revised report in
Phase I), and screenshot of three test cases. Due on Feb 18.
Program in Java and use integer as operands.
After creating expression tree, your program should display the tree as example Figure 4.7 on
page 105. Then the program evaluates the expression tree and prints the result of the
expression.
Phase III: Each group demonstrate your program in about 5 minutes on Feb 18.
Briefly explain the structure of the program. Compile the code, and run two test cases.
Download