|
CSE 1030 - Assignment #1 - Utility Class for Factoring Integers
SC/CSE 1030 - Fall 2012 - Assignment #1
A Utility Class for Factoring Integers
Your goal for this assignment is to develop a Java Utility Class
implementing Integer Factorisation.
Integer Factorisation
is a mathematical procedure with important applications in
Computer Science Theory,
and especially
cryptography.
The API that you will have to create is documented here:
The Factor Class.
To complete this assignment, you must do three things:
Create the Factor class, matching the details given in
the API.
Include Javadoc comments in your source code, so that
the javadoc tool produces an HTML API document identical to
the provided API, when run
with the following command:
javadoc -tag param -tag pre.:a:"Precondition: " -tag return Factor.java
Submit your Factor class electronically before the deadline
using the submit command:
submit 1030 a1 Factor.java
Some notes:
Avoid this "gotcha": The third word in the submit
command above is the letter a and the number one (not the letters
A followed by L).
You must create the complete Factor class, no template is provided.
A Java program that provides a simple command-line interface
and that calls your Factor class to do the factoring, is
available here:
a1.java.
Compile (javac a1.java Factor.java)
run (java a1)
and use this program to test your code.
Your source code should be well organised and documented.
You do not have to implement a fancy nor complicated factorisation
algorithm, a simple loop and test of even divisibility will do.
Remember the Course's, Department's, and the University's
policies on academic honesty - do your own assignment yourself.
(Besides, doing it yourself is the only way to learn!)
This assignment is due on Friday September 14, at noon. Late
assignments will not be accepted.
Start Early - Don't leave your assignment to the last minute!
Remember that you can use the submit command more
than once - if you submit your Factor.java file again, it will
replace the previous submission.
So if you
make a mistake, don't panic, just fix it, and resubmit it
(before the deadline).
Additional information regarding the submit command can be
found by typing man submit at the command line.
Do not use the Type package, nor its earlier
incarnation, the york package.
Your programs must compile and run on the Prism computers.
Your grade will be a number from 0 to 10. The breakdown is
2 marks for properly defining the Factor utility class.
2 marks for a working smallestFactor(int C) function.
4 marks for javadoc comments that match the provided API.
2 marks for coding style (nicely organised code with comments).
Have FUN!
|
|