Starting from:

$20

CSC20- Lab 5: Programming Concepts and Methodology II Solved

Objective: 
The objective of this lab is to get you some experience in using stacks, queues, class packages, and UML.

The programming assignment:

In this lab, you are to write an infix evaluator. Given an input string of characters like

“12+34*(56-7)-18/9”, first print the postfix equivalent “12 34 56 7 - * + 18 9 / -” and then print the value of the expression. 

Notes: In this lab,
 

1.      You must use the algorithms given in class to convert infix expressions to postfix expressions and to evaluate postfix expressions.

2.      You must use the instructor’s stack and queue package.

3.      You must use the instructor’s frame work depicted by the following class diagrams.

4.      Copy directory lab05 from ~wang/sample20.

5.      Complete methods infixToPostfix and evaluatePostfix.

 

More products