Some simple programming exercises taken from the Head First Java book. The directories in this repository are organized by chapter.
There are multiple samples from this chapter, which are organized into their own directories by page number.
- Original description for these assignments:
The code samples on pages 71-79 or 80-86 (from Chapter 4) are, for the most part, not in the context of an entire class, so there is no way to run them.
So, your job is to write a set of classes and main programs that allows all of the code on those pages to be actually run and demonstrated.
In addition, add Javadoc comments, an Ant build.xml file, and targets to run each of the examples.
Call your targets things like run71 run72 run73, etc.
Or, if there is more than one code example on a page, you can make names that make sense such as run83_1 run83_2 etc.
You'll need to use your imagination to come up with what to put along with the code---e.g. some output (System.out.println( ... what??? ) so that you can see that the code is doing something.
Here are the original two archive links for the source code that was used for these examples:
Displays how to use static methods, in particular the Math class. The only example right now comes from pg 286 of HFJ.
Four GUI examples to demonstrate different layouts.
- Original Instructions
Write some code that illustrates each of the Layout manager examples that is shown on pp. 401-412, as well as the example alluded to in in the "there are no dumb questions" of turning off the layout manager and just placing every widget manually.
Give the example GUIs names that correspond to the pages numbers in the book, such as GuiPage401, GuiPage402, etc.