Make Hard Copy of Source Code


Only Documented Hard Copy of Source Code Is Graded

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.

  1. Compose the source code of your program in TextPad.


  2. Save the source code in a separate directory such as h:\source\ch8\ShortEg.java.

  3. Launch a "DOS window": Start >>> Run >>> cmd [Enter].


  4. Navigate your way to the directory housing your source code file: H: [Enter], then cd source\ch8 [Enter]

  5. Compile the source code: H:\source\ch8\> javac ShortEg.java [Enter]

  6. If the program failed to successfully complile, then return to editor, fix errors, and recompile.

  7. If the program successfully compiled, then run the program: H:\source\ch8\> java ShortEg [Enter]

  8. 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.")

  9. Copy the output of the program's execution to just below the source code in the wordprocessor window.

    • Focus (click cursor in window of) the DOS window with the output of the compiled source code.
    • Clear the screen to remove extraneous prompts: H:\source\ch8\>cls [Enter].
    • Rerun the output of the compiled source code: H:\source\ch8\>java ShortEg [Enter].

      Command Line Short Cuts

      Pressing the [UP ARROW] key retrieves prior command line commands.
      Pressing the [DOWN ARROW] key revisits later command line commands.

    • Right mouse click on the top of the DOS window.
    • Using the mouse, scroll through the menu to "Edit" --> "Select All".
    • Press the "Enter" key. This copies the characters from the DOS window to the clipboard.
    • Focus (click cursor in window of) the window containing the source code.
    • Move cursor to two lines below the source code and begin a multi-line "comment": /* Screen Shot
    • Move the cursor to the line immediately below the "/* Screen Shot" line.
    • Copy the clipboard at this position: Simultaneously press the [Ctrl] and [v] keys. (v="moVe.")
    • Place the cursor on the line immediately following the screen dump and type: */

      Closing the DOS Window

      When wishing to close the DOS window, type exit and press [Enter] at the command line prompt.

  10. Save the source code file with the screen shot now included. Simultaneously press [Ctrl] and [s]. (s="Save.")

  11. 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.

  12. Save the source code file with the screen shot now included. Simultaneously press [Ctrl] and [s]. (s="Save.")

  13. If you did everything correctly, then your solution to Chapter 8, Exercise 1 should look similar to ShortEn.java.


  14. 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.


[Counter On Strike [Home of Gerry Donaldson's Com Sci Gate]
[Gerry Donaldson's Email Address]
mailto:gerry@donaldson.org
ICQ# 62833374
[EFC Blue Ribbon - Free Speech Online]

URL:   http://www.donaldson.org/    Last Revised:   September 14, 2003