My favorites | Sign in
Project Logo
          
Search
for
Updated Feb 19, 2009 by klaeu...@gmail.com
Hw2b  
Calculator

Due by midnight on Sunday, February 22nd.

Hw2b Calculator

This project is a more specific, enhanced version of the calculator project 4.20 on page 116 in the Drake text.

  1. (1 point) Create a Java project called yourname-hw2. Add a test folder to the project.
  2. (1 point) Within both folders, src and test, create a Java package called cs271.hw2.yourname.
  3. (1 point) Create a (checked) CalculatorException class that extends Exception (not RuntimeException).
  4. (3 points) Create a Calculator interface with the following methods:
  5. (5 points) Create a CalculatorImpl class that implements the Calculator interface by using an instance of (java.util.)Stack as its evaluation stack.
  6. (5 points) Create a CalculatorTest JUnit 4.x test case that thoroughly tests all methods in the Calculator interface. For example, ensure that the operator methods behave as expected in the various cases (at least two numbers on the stack, fewer than two numbers on the stack); ensure that the most recently pushed number shows up on top of the stack; etc.
  7. (2 points) Create a Main class with a main method that you can run as a Java application. This method should behave similarly to the example in figure 4.39 on page 117. In particular:
  8. (2 points) Provide appropriate javadoc comments for all non-test classes and methods. Run javadoc through Eclipse (or outside Eclipse). Also provide sufficient inline comments explaining your implementation to others (such as myself).

Sign in to add a comment
Powered by Google Project Hosting