Tutorials
Tutorial #7
March 2nd
Recursion - Definitions and Code - pdf
Tutorial #4
January 26
Files - ADT, Implementation of ADT, DataFactory and Application model
You can start up JBuilder/JCreator with an empty project and copy all
of these files in to see how things work.
The specifications of the ADT ThreeDecimal are in ThreeDecimal.java,
and that interface is implemented by TDFraction and TDReal. In both of
these implementations, there is main method testing that the
implementation meets specifications. The central Main method is in
Main.java. The idea of this application is to read decimal numbers from
a file, save them as type ThreeDecimal, and find the maximum
ThreeDecimal number in the file, then output that number to another
file.
In your own project, you would not normally include two separate
implementations of the same ADT, but we included them here to show how
easy it is to switch implementations when you use DataFactories.
Main.java
Application.java
ThreeDecimal.java
TDFraction.java
TDReal.java
DataFactory.java
input.txt
For a pictorial representation of the relationship between these classes,
I drew a cheesy image here. There is a lot of
documentation in the code, explaining the relationship between classes and
why which lines of code are being executed. If you have any questions,
feel free to email me.
Tutorial #3
January 19
- Slides - References and Linked Lists (With solutions!)
pdf
Tutorial #2
January 12
- Slides - ADTs
pdf
- Slides - A1 Help
pdf
Tutorial #1
January 5