657.209B, 2002. Hand-in Project One

Your task is to implement a simple interactive application for fitting lines to data-points.

You are encouraged to work together in groups of two.

Due date: Friday, 23th August

Stuff to submit:

A jar-file including everything. This file should be executable
CHANGED: The name of that file should be YourEMAIL.jar, so if my Email were bmp987, my jar file would be bmp987.jar; if this project is done by two people, e.g. xyz123 and zyx789, use xyz123_zyx789.jar.
The jar-file should contain:
  1. all sources
  2. all class files
  3. Javadoc style documentation. Use the @author tag to give your names and IDs!

Submission procedure:

  1. copy your jarfile to /home/bernhard/Project1: cp bmp987.jar /home/bernhard/Project1
  2. prevent others from reading it: chmod 700 bmp987.jar
  3. change the owner of the file to 'bernhard': chown bernhard bmp987.jar
After that an "ls bmp987.jar" should produce:

-rwx------ 1 bernhard compsci 61234 Aug 13 10:00 bmp987.jar

Specification:

Your application should consist of one graphical pane, where the user can add points by just clicking, as well as five buttons implementing the following functionalities:
  1. Quit: obvious
  2. Clear: reset the graphical pane to no points,
  3. Fit line: compute a regression line for all current points and draw it.
  4. Save: save all current points into a file named "SavedPoints.txt"
  5. Load: read all points defined in file "SavedPoints.txt" and add them to the current points
A simple and easy to parse file format would be one coordinate/line, e.g.

x-coordinate point1
y-coordinate point1
x-coordinate point2
y-coordinate point2
...

A fitting line is easily computed by the following regression equation:

y = a + b*x

where a and b are computed as follows for n points:

a = s1 / d

b = s2 / d

s1 = (Sum y)*(Sum x*x) - (Sum x)*(Sum x*y)

s2 = n*(Sum x*y) - (Sum x)*(Sum y)

d = n*(Sum x*x) - (Sum x)*(Sum x)

Assessment will be based on the following criteria:

  1. Presence of the required features (1, 2, and 3 above).
  2. Clarity and style of programming.
  3. Documentation;

In addition, the following grading policy similar to 312 (Communications and Systems Software) applies:

As always, marks will be subtracted for poor programming practice. Make sure you liberally comment your code and keep good Object Oriented design principles in mind. The grade is made over all deliverables, meaning your documentation will be graded as well as the correctness of program execution.

Late submissions will not be graded without a mitigating Doctor's certificate. It is better to get some marks than no marks, so be sure to submit what you have, even if it isn't complete.


bernhard@cs.waikato.ac.nz
Last modified: Mon Jul 24 11:42:09 NZST 2002