Comp101 Lab 3


In this lab you will continue your java programming experience writing a very simple class with several methods. You will take the part of an applications programmer who is developing a class for another programmer who will build the actual application. 


Assignment Specifications

You will be implementing a class to do some simple calculations. Annother application programmer has built a user interface (and isn't it a beauty!?!???) to function as an extreemly simple calculator. Your job is to write class that does the calculations according to the specifications provided. Because the user interface is written for you, you must write your class exactly as it is specified.

First  copy the skeleton file for this lab to your folder. After you login

cp ~jsantore/ .

Remember that that final dot is important for the command, its not punctuation.
unzip the file as usual


and then cd into the newly created lab3 directory.

You have only one file this time. Morover, it will not compile until you do at least some of your assignment. When everything does compile and you run the program, you should see a window that looks alot like this:initial appearance of the lab3 program

The behavior that we expect to see is this:

When you type an integer into the two text boxes, select one of the radio buttons and press calculate. The result will be displayed on the label next to the calculate button. (the one that says "No Calculations yet" in the picture above.)

Specifications of the class that you must write

You need to write a class with the following specifications

Starting up

When you begin, I suggest that you let xemacs help you out a little. Once you are in your lab3 folder, open the file with the GUI in xemacs


You don't need to look at this file closely or understand it since it does many things that you have not yet learned about.  Select the file menu and choose the "JDE New" submenu and then choose "class" from that submenu. xemacs will ask you in the for the name of the new java file. (in the small text bar at the bottom of xemacs - see image - note that the text colors might be different for you)
emacs querying for a file name
Type in You must define your java class in a file with the same name as the class itself (with the .java extension)
xemacs will now ask you what this class extends. We haven't learned about extending classes so you can simply type enter to default to nothing. The same with the next question about what this class implements.

Now you have a simple class outlined for you. It has a constructor (to which you still need to add the correct parameter ) and nothing more. Now add the instance variable, fix the contructor and add the rest of the methods that you need.


When you submit this time, add a readme.txt file to your lab3 folder that you are building. (In xemacs you create a new file by doing <file><open file> and typing in a brand new file name. The readme should contain:
Once you have the readme done, cd into your parent folder, zip up the entire lab3 folder using the -r flag as you have learned in the last two labs, and use the online submission program to submit it to me.

Due  Friday Oct 12th at 11:59pm (note holiday weekend between now and then)