CSCI 151 - Data Structures and Object-Oriented Development
Spring 2015
Lab 7: Stack-based calculator
- In this lab, we will use our previously developed stack implementation to create a reverse Polish notation calculator.
- Download the provided code.
- Unpack the code into the existing Eclipse Java project from Labs
5 and 6.
- The code includes the following files:
-
rpn package
-
Calculator.java: Run this program to operate the stack-based calculator. You'll be able to see both the current result and all of the stack contents.
-
rpn.model package
-
RPNCalc.java: This is the only file you will modify for this assignment. You will use a stack of integers to implement the RPN calculator. You are free to use
either implementation from the previous labs.
-
RPNCalcTest.java: These are the unit tests for your
calculator. Your grade depends on the
results of the unit tests for your RPNCalc
implementation.
Grading
| Number of Unit Tests Passed | Grade |
| 5 | A+ |
| 4 | B |
| 3 | C |
| 2 | D |