Only hard copy (ie: paper copy) of the documented source code of your
java program is graded. You will not usually be asked for an electronic
copy of your program. Here are the steps to preparing the documented hard
copy.
-
Compose the source code of your program in TextPad.

-
Save the source code in a separate directory such as
h:\source\ch8\ShortEg.java.
-
Launch a "DOS window": Start >>> Run >>> cmd
[Enter].

-
Navigate your way to the directory housing your source code file:
H: [Enter], then cd source\ch8 [Enter]
-
Compile the source code: H:\source\ch8\> javac ShortEg.java
[Enter]
-
If the program failed to successfully complile, then return to
editor, fix errors, and recompile.
-
If the program successfully compiled, then run the program:
H:\source\ch8\> java ShortEg [Enter]
-
If the program successfully ran, then copy the source code to a
wordprocessor such as WORD:
- Focus (click cursor in window of) the window containing the source
code.
- Copy all of the source code to the clipboard: Simultaneously
press the [Ctrl] and [a] keys. (a="All".)
- Focus (click curson in window of) the wordprocessor.
- Copy the source code from the clipboard: Simultaneously press
the [Ctrl] and [v] keys. (V="moVe.")
-
Copy the output of the program's execution to just below the source
code in the wordprocessor window.
-
Save the source code file with the screen shot now included.
Simultaneously press [Ctrl] and [s]. (s="Save.")
-
Insert and update your Identification Header at the
beginning of the source code.
- Focus (click cursor in window of) the window containing the source
code.
- Move the cursor to the HOME position (upper left corner) of the
window.
- Move all the text down a couple of lines by twice pressing
[Enter].
- Again move the cursor to the HOME position (upper left corner) of
the window.
- Note that you must insert and not just open the
id.java file. Opening the id.java file at this point will simply put
the id.java code in another window.
- Click through the menu: Edit >>> Insert >>> File
(Shortcut = simultaneously pressing [Ctrl][Shift][v])
- Focus on the file, id.java
- Left click the [Open] button.
- Update the identification header entries.
-
Save the source code file with the screen shot now included.
Simultaneously press [Ctrl] and [s]. (s="Save.")
-
If you did everything correctly, then your solution to Chapter
8, Exercise 1 should look similar to ShortEn.java.

-
Print the documented source code using both sides of the sheet(s) of
paper, printing two pages per side.
- Focus on the wordprocessor window containing the source code and
screen dump.
- Launch the dialog box for printing. Simultaneously press [Ctrl]
and [p]. (p="Print".)
- Click on the ["Properties...] button.
- Click on "Features" or perhaps "Layout".
- Choose "Two-Sided Printing".
- Choose "Two Pages Per Sheet".
- Press the [Enter] key.
