CIS 590/591 Calculator
Fall 2013, Arvind Bhusnurmath & David Matuszek

Purpose of this assignment

General idea of the assignment

We are trying to create a desktop application that has the look and feel of If you hit that URL, and try checking the source, you will find that this particular calculator is implemented in Flash, which has basically taken over where applets left off (that is a horribly condensed version of the history of UI).

You will notice that "clear" does not appear as a button in the online version. I did not like that. So I want you to just make that into a button. In particular your final calculator looks like:


Imagine you have a client out there who does not know programming. They see the online version linked to above. They like it but they hate the fact that they have to be connected to internet and connected to the internet on a device that has supports Flash. Hence their demand for a desktop application.


Create a project Calculator, and within that a package calculator. All your classes will go into this package.

abstract class CalculatorButton extends Button

class Calculator extends JFrame

class CalculatorChip

This class should have the following methods, each of which displays a string to be shown in the calculator display (JTextField). The string should not contain any whitespace.

You should try to make your calculator behave as much like the online calculator as possible. You probably think you know how a calculator behaves, but do you really? For example, can you predict the result of 2x=== ?

Due date

Save your complete program, including source code, in an executable .jar file. Eclipse can create this file for you--select your project in the Package explorer, Export your project to a Java → jar file, and step through the menus selecting Next> until you can choose Calculator as your Main class. If Java is installed correctly on your computer, double-clicking this jar file will run your calculator.

Zip up your project and submit to Canvas by 6am next Friday, November 22.