back
Please email me if you have any comments, questions, or suggestions.

Click on the p.html link to run my senior project.

Clear canvas clears the data and calculate calculates the greatest common divisors(gcd) and least common mutliples(lcm).

p.html

For those of you who may not be aware of what my program is for, it can be used to look at properties of patterns in pascals triangle. For example make a pattern like the following and calculate.

No matter where you do it on the triangle, the gcds of the group should be the same, and (if I remember correctly) the lcm of one group should be a multiple of the lcm of the other.

Finished what should be my final major revision.
The features:


-Calculate GCDs and LCMs as long as the group elements are not selected from a row larger than 100 (the program can be modified to increase this if it turns out to be wanted). It can take a few seconds to calculate the values of the larger numbers, and the numbers may take up more room than fit in the text boxes but if you click on the textbox you can move the cursor around to see it all.

-Move your pattern around on the triangle using buttons. This way if you want to look at a certain pattern in different places it is not necessary to re-enter the points at each place in the triangle.

-Generate a report that displays GCD and LCM info for the pattern you have selected over whatever rows you select in the report form. Caution: If you do too many rows in a single report the program may crash. In my experience Netscape deals with the larger numbers quicker than Internet Explorer but also seems more likely to crash (due to report size(?)) than Internet Explorer. In fact, I have run pretty big reports on IE and though, it took quite awhile, it didn't crash at all. If you have trouble with it crashing, you can break the report down into separate reports each taking a smaller section of rows as needed. There is the option to make a delimited report which you should be able to copy and paste into a file which can then be imported into a spreadsheet program such as Excel where the data will be more easily viewed.



I also have modified the program so that it can write a report directly to file. This saves copying and pasting as well as allowing reports (if they are done to file only) to be as long as you want without crashing the program (although the hundred row limit still holds). Unfortunately, due to java security concerns, to create a program that can write to file it is necessary for it to be an application which cannot be run from a webpage as normal java applets can. This means that you need the java runtime environment to run the program.

A self-extracting file containing this program.

The java runtime environment (JRE) for this version (1.1.8) of java is available here.

If you have trouble setting this up and want some help, drop me a line I would be glad to help.


Following are the files that make up my program.

P.java
CCanvas.java
xyArray.java
ScrollbarHandler.java