Comp 102 Project 4: Windowed Programming

Due Sat April 10th at 11:59pm. (But I'll happily accept them before that as well for those who don't want to work on a Saturday)

Objective:

The high level objectives of this lab are:


What you must do:

You must build a graphical calculator that will allow you to do simple arithmetic. Your calculator needs to allow a user to input multi digit numbers. (For the sake of easier programming, you may assume that the user will never type in more than an 8 digit number, though you need not enforce this.) Your calculator should accept numeric input  when you press one of the number buttons with the mouse. You should allow the user to type into the text field as well. (This means that you may get non-numeric input and you have to catch that exception and handle it properly.) When an arithmetic operation is selected, keep track of the current number in your display, zero out the display, and keep track of the current operation. When the equals button is pressed, take the current number in the display, the stored number and the stored operation, and apply the operation to the two numbers, then display the result in the display field. A sample user interface for this program is shown below.

sample calculator UI

You may use any other user interface that you find easy to make and functions well as a calculator.

You should handle addition, subtraction, multiplication, division and Square Root operations. Square root will work differently than the rest since it is a unary operation of course.


Extra Requirements:

You must satisfy the following constraints on your program

Submitting:

When your program is ready, you need to write a readme.txt file that provides me the following information:



When your readme and your code is ready, zip up your files and submit them online as you have done for the recent labs