CIS 11: Data Structures and Algorithms
Project F
Complete Project 10 from Chapter 7 of the text. Directions are on page 387.
- Use the program available here as your starting point instead of the one from the book. The primary difference is that the one you'll modify reads it's expressions (one or more) to evaluate from a text file named expressions.dat.
- You may use the expression class, found in expression.h,
to hold the infix and the intermediate postfix expressions if you wish.
- If you decide to use the expression class, your read_and_evaluate() function might look something like:
double read_and_evaluate(istream& i) {
if (i.peek() != '\n') {
expression inFix(i);
expression postFix = convertToPostFix(inFix);
return evaluatePostFix(postFix); }
}
- Test your program thouroughly with your own test file. You will not submit that file.
When you're satisfied with
the program, submit your work via the CATE
form for Project F.
Legend: method/function keyword literal
2007/03/31