Project 8: Another calculator

The goal of this project is to put the state pattern to use.

1. Introduction

You will be writing one last calculator program for this class. This time we'll be back to a normal calculator. But this time you will be incorporating what we learned about the state pattern in your design of the calculator.

2. Setup

In this project you will use the same GUI and other starter code as the other calculator projects.

cp -r ~tvandrun/Public/cs245/proj2/* .

3. Calculator details

Now you'll be operating under the following rules:

4. Specification details

See the equivalent section from Project 2. All those things count here, too.

5. Reminder about setup()

(Largely repeated from project 5)

To clarify one part of the framework for this and other calculator projects, please note that when your submission is graded, your setUpCalculator() method will be called, and it will be given an object implementing the CalculatorFace interface you are given, but it will not be an instance of the ConcreteCalculatorFace class. ConcreteCalculatorFace is given for your own testing purposes. That is why your code should not be dependent on that class, only on the interface. Also, the main method of SetUp will not be called, only the setUpCalculator() method. In short, the contract you need to fulfill is

When setUpCalculator() is given an object implementing the interface CalculatorFace, it will instantiate and attach action listeners to the given object (and instantiate any other appropriate classes, ie the "brain" or whatever you call it) so that the given object will behave like a calculator.

6. To turn in

Please turn in all the files you wrote or modified (ie, the files you didn't modify don't need to be turned in) to a turn-in directory. To turn in a specific file, do

cp (some file) /cslab.all/ubuntu/cs245/turnin/(your user id)/proj8

DUE: Wednesday, Dec 9, 5:00 pm. Note that if still have your two late days, then this makes Friday, Dec 11 (the last day of classes) the effective due date. Moreover, this project overlaps with project 9 (which will be a short project); project 9 will be due Dec 12, and no late days may be applied to project 9.

7. Grading

Grading for this project will follow this approximate point breakdown (the right to make minor adjustments in point distribution is reserved):

Note both that this project is worth a little more in total than Project 2 (22 points vs 20 points) and that design and style is worth more proportionately.


Thomas VanDrunen
Last modified: Tue Aug 4 11:19:49 CDT 2015